diff --git a/.travis.yml b/.travis.yml index b7e3aa7093..f7ca29f130 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ matrix: env: global: - - STRIPE_MOCK_VERSION=0.105.0 + - STRIPE_MOCK_VERSION=0.106.0 cache: directories: - $HOME/.composer/cache/files diff --git a/tests/Stripe/Service/TaxCodeServiceTest.php b/tests/Stripe/Service/TaxCodeServiceTest.php new file mode 100644 index 0000000000..4a4b39df23 --- /dev/null +++ b/tests/Stripe/Service/TaxCodeServiceTest.php @@ -0,0 +1,50 @@ +client = new \Stripe\StripeClient(['api_key' => 'sk_test_123', 'api_base' => MOCK_URL]); + $this->service = new TaxCodeService($this->client); + } + + public function testAll() + { + $this->expectsRequest( + 'get', + '/v1/tax_codes' + ); + $resources = $this->service->all(); + static::assertInternalType('array', $resources->data); + static::assertInstanceOf(\Stripe\TaxCode::class, $resources->data[0]); + } + + public function testRetrieve() + { + $this->expectsRequest( + 'get', + '/v1/tax_codes/' . self::TEST_RESOURCE_ID + ); + $resource = $this->service->retrieve(self::TEST_RESOURCE_ID); + static::assertInstanceOf(\Stripe\TaxCode::class, $resource); + } +} diff --git a/tests/Stripe/TaxCode.php b/tests/Stripe/TaxCode.php new file mode 100644 index 0000000000..744f2529e4 --- /dev/null +++ b/tests/Stripe/TaxCode.php @@ -0,0 +1,35 @@ +expectsRequest( + 'get', + '/v1/tax_codes' + ); + $resources = TaxCode::all(); + static::assertInternalType('array', $resources->data); + static::assertInstanceOf(\Stripe\TaxCode::class, $resources->data[0]); + } + + public function testIsRetrievable() + { + $this->expectsRequest( + 'get', + '/v1/tax_codes/' . self::TEST_RESOURCE_ID + ); + $resource = TaxCode::retrieve(self::TEST_RESOURCE_ID); + static::assertInstanceOf(\Stripe\TaxCode::class, $resource); + } +}