From acf5be775aa851e676f97f0af1ac7d6a341df851 Mon Sep 17 00:00:00 2001 From: Steve Barbera Date: Thu, 10 Sep 2020 10:28:46 -0600 Subject: [PATCH 1/2] Updated the tests to pass correctly. Updated the test to expect an Exception instead of throwing an unhandled error. Added SANDBOX_USERNAME and SANDBOX_PASSWORD to the phpunit.xml so that the tests can be used. Added a README note on how to run the tests. --- README.md | 6 ++++++ tests/basicWorkflowTest.php | 2 ++ tests/phpunit.xml | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f4e90b5..c12bb6e 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,9 @@ echo('
' . json_encode($t, JSON_PRETTY_PRINT) . '
'); ?> ``` + +# Running the Tests + +Update the `tests/phpunit.xml` set the `SANDBOX_USERNAME` and the `SANDBOX_PASSWORD` to your username and password. + +You can then run the tests using phpunit with the following command: `phpunit -c tests/phpunit.xml` diff --git a/tests/basicWorkflowTest.php b/tests/basicWorkflowTest.php index 63391fb..84314d4 100644 --- a/tests/basicWorkflowTest.php +++ b/tests/basicWorkflowTest.php @@ -12,6 +12,8 @@ final class AvaTaxClientTest extends TestCase */ public function testConstructorThrowsExceptionForMissingRequirements() { + $this->expectException('Exception'); + new Avalara\AvaTaxClient('', '', '', ''); } diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 1b42d14..a441d21 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -2,4 +2,8 @@ ./ - \ No newline at end of file + + + + + From d0aa9836a758f13702a0e885c6545bf5b8dedd69 Mon Sep 17 00:00:00 2001 From: Steve Barbera Date: Thu, 10 Sep 2020 10:30:19 -0600 Subject: [PATCH 2/2] Updated guzzlehttp/guzzle to version ~7. Tests are passing correctly. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2ffc646..64484cd 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "type": "library", "require": { "php": ">=5.5.9", - "guzzlehttp/guzzle": "~6" + "guzzlehttp/guzzle": "~7" }, "require-dev": { "phpunit/phpunit": "5.7"