From 6d417dc0d939f6233f0c1880375908983e5d0d22 Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Fri, 26 Apr 2019 21:05:35 +0200 Subject: [PATCH] Replaced all cases of explicit class strings with the SomeClass:class constant available in 5.6. --- lib/ApiOperations/All.php | 8 +- lib/Util/Util.php | 148 +++++++++++----------- tests/Stripe/AccountLinkTest.php | 2 +- tests/Stripe/AccountTest.php | 32 ++--- tests/Stripe/AlipayAccountTest.php | 4 +- tests/Stripe/ApplePayDomainTest.php | 8 +- tests/Stripe/ApplicationFeeRefundTest.php | 2 +- tests/Stripe/ApplicationFeeTest.php | 14 +- tests/Stripe/BalanceTest.php | 2 +- tests/Stripe/BalanceTransactionTest.php | 4 +- tests/Stripe/BankAccountTest.php | 6 +- tests/Stripe/BitcoinReceiverTest.php | 4 +- tests/Stripe/CardTest.php | 4 +- tests/Stripe/ChargeTest.php | 22 ++-- tests/Stripe/CountrySpecTest.php | 4 +- tests/Stripe/CouponTest.php | 12 +- tests/Stripe/CustomerTest.php | 26 ++-- tests/Stripe/DisputeTest.php | 10 +- tests/Stripe/EphemeralKeyTest.php | 4 +- tests/Stripe/Error/BaseTest.php | 2 +- tests/Stripe/EventTest.php | 4 +- tests/Stripe/FileCreationTest.php | 4 +- tests/Stripe/FileLinkTest.php | 10 +- tests/Stripe/FileTest.php | 8 +- tests/Stripe/InvoiceItemTest.php | 12 +- tests/Stripe/InvoiceTest.php | 24 ++-- tests/Stripe/IssuerFraudRecordTest.php | 4 +- tests/Stripe/OrderReturnTest.php | 4 +- tests/Stripe/OrderTest.php | 14 +- tests/Stripe/PaymentIntentTest.php | 16 +-- tests/Stripe/PaymentMethodTest.php | 14 +- tests/Stripe/PayoutTest.php | 12 +- tests/Stripe/PersonTest.php | 4 +- tests/Stripe/PlanTest.php | 12 +- tests/Stripe/ProductTest.php | 12 +- tests/Stripe/Radar/ValueListTest.php | 12 +- tests/Stripe/RecipientTest.php | 14 +- tests/Stripe/RefundTest.php | 10 +- tests/Stripe/ReviewTest.php | 6 +- tests/Stripe/SKUTest.php | 12 +- tests/Stripe/SourceTest.php | 14 +- tests/Stripe/StripeObjectTest.php | 8 +- tests/Stripe/SubscriptionItemTest.php | 14 +- tests/Stripe/SubscriptionScheduleTest.php | 18 +-- tests/Stripe/SubscriptionTest.php | 14 +- tests/Stripe/ThreeDSecureTest.php | 4 +- tests/Stripe/TokenTest.php | 4 +- tests/Stripe/TopupTest.php | 12 +- tests/Stripe/TransferReversalTest.php | 2 +- tests/Stripe/TransferTest.php | 22 ++-- tests/Stripe/UsageRecordTest.php | 2 +- tests/Stripe/WebhookEndpointTest.php | 12 +- 52 files changed, 326 insertions(+), 326 deletions(-) diff --git a/lib/ApiOperations/All.php b/lib/ApiOperations/All.php index 2762748f9..6ae462713 100644 --- a/lib/ApiOperations/All.php +++ b/lib/ApiOperations/All.php @@ -22,10 +22,10 @@ public static function all($params = null, $opts = null) list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - if (!is_a($obj, 'Stripe\\Collection')) { - $class = get_class($obj); - $message = "Expected type \"Stripe\\Collection\", got \"$class\" instead"; - throw new \Stripe\Error\Api($message); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Error\Api( + 'Expected type ' . \Stripe\Collection::class . ', got "' . get_class($obj) . '" instead.' + ); } $obj->setLastResponse($response); $obj->setRequestParams($params); diff --git a/lib/Util/Util.php b/lib/Util/Util.php index 03b80ee30..b46d887d6 100644 --- a/lib/Util/Util.php +++ b/lib/Util/Util.php @@ -67,81 +67,81 @@ public static function convertToStripeObject($resp, $opts) { $types = [ // data structures - \Stripe\Collection::OBJECT_NAME => 'Stripe\\Collection', + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, // business objects - \Stripe\Account::OBJECT_NAME => 'Stripe\\Account', - \Stripe\AccountLink::OBJECT_NAME => 'Stripe\\AccountLink', - \Stripe\AlipayAccount::OBJECT_NAME => 'Stripe\\AlipayAccount', - \Stripe\ApplePayDomain::OBJECT_NAME => 'Stripe\\ApplePayDomain', - \Stripe\ApplicationFee::OBJECT_NAME => 'Stripe\\ApplicationFee', - \Stripe\Balance::OBJECT_NAME => 'Stripe\\Balance', - \Stripe\BalanceTransaction::OBJECT_NAME => 'Stripe\\BalanceTransaction', - \Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount', - \Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver', - \Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction', - \Stripe\Card::OBJECT_NAME => 'Stripe\\Card', - \Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge', - \Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session', - \Stripe\CountrySpec::OBJECT_NAME => 'Stripe\\CountrySpec', - \Stripe\Coupon::OBJECT_NAME => 'Stripe\\Coupon', - \Stripe\Customer::OBJECT_NAME => 'Stripe\\Customer', - \Stripe\Discount::OBJECT_NAME => 'Stripe\\Discount', - \Stripe\Dispute::OBJECT_NAME => 'Stripe\\Dispute', - \Stripe\EphemeralKey::OBJECT_NAME => 'Stripe\\EphemeralKey', - \Stripe\Event::OBJECT_NAME => 'Stripe\\Event', - \Stripe\ExchangeRate::OBJECT_NAME => 'Stripe\\ExchangeRate', - \Stripe\ApplicationFeeRefund::OBJECT_NAME => 'Stripe\\ApplicationFeeRefund', - \Stripe\File::OBJECT_NAME => 'Stripe\\File', - \Stripe\File::OBJECT_NAME_ALT => 'Stripe\\File', - \Stripe\FileLink::OBJECT_NAME => 'Stripe\\FileLink', - \Stripe\Invoice::OBJECT_NAME => 'Stripe\\Invoice', - \Stripe\InvoiceItem::OBJECT_NAME => 'Stripe\\InvoiceItem', - \Stripe\InvoiceLineItem::OBJECT_NAME => 'Stripe\\InvoiceLineItem', - \Stripe\IssuerFraudRecord::OBJECT_NAME => 'Stripe\\IssuerFraudRecord', - \Stripe\Issuing\Authorization::OBJECT_NAME => 'Stripe\\Issuing\\Authorization', - \Stripe\Issuing\Card::OBJECT_NAME => 'Stripe\\Issuing\\Card', - \Stripe\Issuing\CardDetails::OBJECT_NAME => 'Stripe\\Issuing\\CardDetails', - \Stripe\Issuing\Cardholder::OBJECT_NAME => 'Stripe\\Issuing\\Cardholder', - \Stripe\Issuing\Dispute::OBJECT_NAME => 'Stripe\\Issuing\\Dispute', - \Stripe\Issuing\Transaction::OBJECT_NAME => 'Stripe\\Issuing\\Transaction', - \Stripe\LoginLink::OBJECT_NAME => 'Stripe\\LoginLink', - \Stripe\Order::OBJECT_NAME => 'Stripe\\Order', - \Stripe\OrderItem::OBJECT_NAME => 'Stripe\\OrderItem', - \Stripe\OrderReturn::OBJECT_NAME => 'Stripe\\OrderReturn', - \Stripe\PaymentIntent::OBJECT_NAME => 'Stripe\\PaymentIntent', - \Stripe\PaymentMethod::OBJECT_NAME => 'Stripe\\PaymentMethod', - \Stripe\Payout::OBJECT_NAME => 'Stripe\\Payout', - \Stripe\Person::OBJECT_NAME => 'Stripe\\Person', - \Stripe\Plan::OBJECT_NAME => 'Stripe\\Plan', - \Stripe\Product::OBJECT_NAME => 'Stripe\\Product', - \Stripe\Radar\ValueList::OBJECT_NAME => 'Stripe\\Radar\\ValueList', - \Stripe\Radar\ValueListItem::OBJECT_NAME => 'Stripe\\Radar\\ValueListItem', - \Stripe\Recipient::OBJECT_NAME => 'Stripe\\Recipient', - \Stripe\RecipientTransfer::OBJECT_NAME => 'Stripe\\RecipientTransfer', - \Stripe\Refund::OBJECT_NAME => 'Stripe\\Refund', - \Stripe\Reporting\ReportRun::OBJECT_NAME => 'Stripe\\Reporting\\ReportRun', - \Stripe\Reporting\ReportType::OBJECT_NAME => 'Stripe\\Reporting\\ReportType', - \Stripe\Review::OBJECT_NAME => 'Stripe\\Review', - \Stripe\SKU::OBJECT_NAME => 'Stripe\\SKU', - \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => 'Stripe\\Sigma\\ScheduledQueryRun', - \Stripe\Source::OBJECT_NAME => 'Stripe\\Source', - \Stripe\SourceTransaction::OBJECT_NAME => 'Stripe\\SourceTransaction', - \Stripe\Subscription::OBJECT_NAME => 'Stripe\\Subscription', - \Stripe\SubscriptionItem::OBJECT_NAME => 'Stripe\\SubscriptionItem', - \Stripe\SubscriptionSchedule::OBJECT_NAME => 'Stripe\\SubscriptionSchedule', - \Stripe\SubscriptionScheduleRevision::OBJECT_NAME => 'Stripe\\SubscriptionScheduleRevision', - \Stripe\ThreeDSecure::OBJECT_NAME => 'Stripe\\ThreeDSecure', - \Stripe\Terminal\ConnectionToken::OBJECT_NAME => 'Stripe\\Terminal\\ConnectionToken', - \Stripe\Terminal\Location::OBJECT_NAME => 'Stripe\\Terminal\\Location', - \Stripe\Terminal\Reader::OBJECT_NAME => 'Stripe\\Terminal\\Reader', - \Stripe\Token::OBJECT_NAME => 'Stripe\\Token', - \Stripe\Topup::OBJECT_NAME => 'Stripe\\Topup', - \Stripe\Transfer::OBJECT_NAME => 'Stripe\\Transfer', - \Stripe\TransferReversal::OBJECT_NAME => 'Stripe\\TransferReversal', - \Stripe\UsageRecord::OBJECT_NAME => 'Stripe\\UsageRecord', - \Stripe\UsageRecordSummary::OBJECT_NAME => 'Stripe\\UsageRecordSummary', - \Stripe\WebhookEndpoint::OBJECT_NAME => 'Stripe\\WebhookEndpoint', + \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, + \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, + \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, + \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, + \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, + \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, + \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, + \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, + \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, + \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\IssuerFraudRecord::OBJECT_NAME => \Stripe\IssuerFraudRecord::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, + \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, + \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, + \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, + \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, + \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, + \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, + \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, + \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, + \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, + \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, + \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, + \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, + \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, + \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, + \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\SubscriptionScheduleRevision::OBJECT_NAME => \Stripe\SubscriptionScheduleRevision::class, + \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, + \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, + \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, + \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, + \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, + \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, + \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, ]; if (self::isList($resp)) { $mapped = []; @@ -153,7 +153,7 @@ public static function convertToStripeObject($resp, $opts) if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) { $class = $types[$resp['object']]; } else { - $class = 'Stripe\\StripeObject'; + $class = \Stripe\StripeObject::class; } return $class::constructFrom($resp, $opts); } else { diff --git a/tests/Stripe/AccountLinkTest.php b/tests/Stripe/AccountLinkTest.php index 86e6aafbb..0ecb2e239 100644 --- a/tests/Stripe/AccountLinkTest.php +++ b/tests/Stripe/AccountLinkTest.php @@ -16,6 +16,6 @@ public function testIsCreatable() "success_url" => "https://stripe.com/success", "type" => "custom_account_verification", ]); - $this->assertInstanceOf("Stripe\\AccountLink", $resource); + $this->assertInstanceOf(\Stripe\AccountLink::class, $resource); } } diff --git a/tests/Stripe/AccountTest.php b/tests/Stripe/AccountTest.php index fa3850308..26c178c55 100644 --- a/tests/Stripe/AccountTest.php +++ b/tests/Stripe/AccountTest.php @@ -16,7 +16,7 @@ public function testIsListable() ); $resources = Account::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Account", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Account::class, $resources->data[0]); } public function testIsRetrievable() @@ -26,7 +26,7 @@ public function testIsRetrievable() '/v1/accounts/' . self::TEST_RESOURCE_ID ); $resource = Account::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsRetrievableWithoutId() @@ -36,7 +36,7 @@ public function testIsRetrievableWithoutId() '/v1/account' ); $resource = Account::retrieve(); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsCreatable() @@ -46,7 +46,7 @@ public function testIsCreatable() '/v1/accounts' ); $resource = Account::create(["type" => "custom"]); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsSaveable() @@ -58,7 +58,7 @@ public function testIsSaveable() '/v1/accounts/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsUpdatable() @@ -70,7 +70,7 @@ public function testIsUpdatable() $resource = Account::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsDeletable() @@ -81,7 +81,7 @@ public function testIsDeletable() '/v1/accounts/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); } public function testIsRejectable() @@ -92,7 +92,7 @@ public function testIsRejectable() '/v1/accounts/' . $account->id . '/reject' ); $resource = $account->reject(["reason" => "fraud"]); - $this->assertInstanceOf("Stripe\\Account", $resource); + $this->assertInstanceOf(\Stripe\Account::class, $resource); $this->assertSame($resource, $account); } @@ -126,7 +126,7 @@ public function testPersons() ); $persons = $account->persons(); $this->assertTrue(is_array($persons->data)); - $this->assertInstanceOf("Stripe\\Person", $persons->data[0]); + $this->assertInstanceOf(\Stripe\Person::class, $persons->data[0]); } public function testCanCreateExternalAccount() @@ -138,7 +138,7 @@ public function testCanCreateExternalAccount() $resource = Account::createExternalAccount(self::TEST_RESOURCE_ID, [ "external_account" => "btok_123", ]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); + $this->assertInstanceOf(\Stripe\BankAccount::class, $resource); } public function testCanRetrieveExternalAccount() @@ -148,7 +148,7 @@ public function testCanRetrieveExternalAccount() '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts/' . self::TEST_EXTERNALACCOUNT_ID ); $resource = Account::retrieveExternalAccount(self::TEST_RESOURCE_ID, self::TEST_EXTERNALACCOUNT_ID); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); + $this->assertInstanceOf(\Stripe\BankAccount::class, $resource); } public function testCanUpdateExternalAccount() @@ -160,7 +160,7 @@ public function testCanUpdateExternalAccount() $resource = Account::updateExternalAccount(self::TEST_RESOURCE_ID, self::TEST_EXTERNALACCOUNT_ID, [ "name" => "name", ]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); + $this->assertInstanceOf(\Stripe\BankAccount::class, $resource); } public function testCanDeleteExternalAccount() @@ -190,7 +190,7 @@ public function testCanCreateLoginLink() '/v1/accounts/' . self::TEST_RESOURCE_ID . '/login_links' ); $resource = Account::createLoginLink(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\LoginLink", $resource); + $this->assertInstanceOf(\Stripe\LoginLink::class, $resource); } public function testCanCreatePerson() @@ -206,7 +206,7 @@ public function testCanCreatePerson() "year" => 1980 ] ]); - $this->assertInstanceOf("Stripe\\Person", $resource); + $this->assertInstanceOf(\Stripe\Person::class, $resource); } public function testCanRetrievePerson() @@ -216,7 +216,7 @@ public function testCanRetrievePerson() '/v1/accounts/' . self::TEST_RESOURCE_ID . '/persons/' . self::TEST_PERSON_ID ); $resource = Account::retrievePerson(self::TEST_RESOURCE_ID, self::TEST_PERSON_ID); - $this->assertInstanceOf("Stripe\\Person", $resource); + $this->assertInstanceOf(\Stripe\Person::class, $resource); } public function testCanUpdatePerson() @@ -228,7 +228,7 @@ public function testCanUpdatePerson() $resource = Account::updatePerson(self::TEST_RESOURCE_ID, self::TEST_PERSON_ID, [ "first_name" => "First name", ]); - $this->assertInstanceOf("Stripe\\Person", $resource); + $this->assertInstanceOf(\Stripe\Person::class, $resource); } public function testCanDeletePerson() diff --git a/tests/Stripe/AlipayAccountTest.php b/tests/Stripe/AlipayAccountTest.php index 7159f5444..cb48a1007 100644 --- a/tests/Stripe/AlipayAccountTest.php +++ b/tests/Stripe/AlipayAccountTest.php @@ -50,7 +50,7 @@ public function testIsSaveable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertSame("Stripe\\AlipayAccount", get_class($resource)); + $this->assertSame(\Stripe\AlipayAccount::class, get_class($resource)); } /** @@ -71,6 +71,6 @@ public function testIsDeletable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertSame("Stripe\\AlipayAccount", get_class($resource)); + $this->assertSame(\Stripe\AlipayAccount::class, get_class($resource)); } } diff --git a/tests/Stripe/ApplePayDomainTest.php b/tests/Stripe/ApplePayDomainTest.php index d033f55cb..5b64cabfd 100644 --- a/tests/Stripe/ApplePayDomainTest.php +++ b/tests/Stripe/ApplePayDomainTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = ApplePayDomain::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resources->data[0]); + $this->assertInstanceOf(\Stripe\ApplePayDomain::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/apple_pay/domains/' . self::TEST_RESOURCE_ID ); $resource = ApplePayDomain::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); + $this->assertInstanceOf(\Stripe\ApplePayDomain::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = ApplePayDomain::create([ "domain_name" => "domain", ]); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); + $this->assertInstanceOf(\Stripe\ApplePayDomain::class, $resource); } public function testIsDeletable() @@ -47,6 +47,6 @@ public function testIsDeletable() '/v1/apple_pay/domains/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); + $this->assertInstanceOf(\Stripe\ApplePayDomain::class, $resource); } } diff --git a/tests/Stripe/ApplicationFeeRefundTest.php b/tests/Stripe/ApplicationFeeRefundTest.php index 9af059ff7..fda6feea1 100644 --- a/tests/Stripe/ApplicationFeeRefundTest.php +++ b/tests/Stripe/ApplicationFeeRefundTest.php @@ -16,6 +16,6 @@ public function testIsSaveable() '/v1/application_fees/' . $resource->fee . '/refunds/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $resource); } } diff --git a/tests/Stripe/ApplicationFeeTest.php b/tests/Stripe/ApplicationFeeTest.php index 66e007ff3..2feb4ccd1 100644 --- a/tests/Stripe/ApplicationFeeTest.php +++ b/tests/Stripe/ApplicationFeeTest.php @@ -15,7 +15,7 @@ public function testIsListable() ); $resources = ApplicationFee::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resources->data[0]); + $this->assertInstanceOf(\Stripe\ApplicationFee::class, $resources->data[0]); } public function testIsRetrievable() @@ -25,7 +25,7 @@ public function testIsRetrievable() '/v1/application_fees/' . self::TEST_RESOURCE_ID ); $resource = ApplicationFee::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFee::class, $resource); } public function testIsRefundable() @@ -36,7 +36,7 @@ public function testIsRefundable() '/v1/application_fees/' . $fee->id . '/refunds' ); $resource = $fee->refund(); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFee::class, $resource); $this->assertSame($resource, $fee); } @@ -47,7 +47,7 @@ public function testCanCreateRefund() '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds' ); $resource = ApplicationFee::createRefund(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $resource); } public function testCanRetrieveRefund() @@ -57,7 +57,7 @@ public function testCanRetrieveRefund() '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds/' . self::TEST_FEEREFUND_ID ); $resource = ApplicationFee::retrieveRefund(self::TEST_RESOURCE_ID, self::TEST_FEEREFUND_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $resource); } public function testCanUpdateRefund() @@ -67,7 +67,7 @@ public function testCanUpdateRefund() '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds/' . self::TEST_FEEREFUND_ID ); $resource = ApplicationFee::updateRefund(self::TEST_RESOURCE_ID, self::TEST_FEEREFUND_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); + $this->assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $resource); } public function testCanListRefunds() @@ -78,6 +78,6 @@ public function testCanListRefunds() ); $resources = ApplicationFee::allRefunds(self::TEST_RESOURCE_ID); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resources->data[0]); + $this->assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $resources->data[0]); } } diff --git a/tests/Stripe/BalanceTest.php b/tests/Stripe/BalanceTest.php index ccbdbdfb7..dbdcd8e68 100644 --- a/tests/Stripe/BalanceTest.php +++ b/tests/Stripe/BalanceTest.php @@ -11,6 +11,6 @@ public function testIsRetrievable() '/v1/balance' ); $resource = Balance::retrieve(); - $this->assertInstanceOf("Stripe\\Balance", $resource); + $this->assertInstanceOf(\Stripe\Balance::class, $resource); } } diff --git a/tests/Stripe/BalanceTransactionTest.php b/tests/Stripe/BalanceTransactionTest.php index 8785e8591..9474c61e8 100644 --- a/tests/Stripe/BalanceTransactionTest.php +++ b/tests/Stripe/BalanceTransactionTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = BalanceTransaction::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\BalanceTransaction", $resources->data[0]); + $this->assertInstanceOf(\Stripe\BalanceTransaction::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,6 +24,6 @@ public function testIsRetrievable() '/v1/balance/history/' . self::TEST_RESOURCE_ID ); $resource = BalanceTransaction::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\BalanceTransaction", $resource); + $this->assertInstanceOf(\Stripe\BalanceTransaction::class, $resource); } } diff --git a/tests/Stripe/BankAccountTest.php b/tests/Stripe/BankAccountTest.php index ab1dff9d5..33ab4f792 100644 --- a/tests/Stripe/BankAccountTest.php +++ b/tests/Stripe/BankAccountTest.php @@ -59,7 +59,7 @@ public function testIsSaveable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertSame("Stripe\\BankAccount", get_class($resource)); + $this->assertSame(\Stripe\BankAccount::class, get_class($resource)); } /** @@ -80,7 +80,7 @@ public function testIsDeletable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertSame("Stripe\\BankAccount", get_class($resource)); + $this->assertSame(\Stripe\BankAccount::class, get_class($resource)); } public function testIsVerifiable() @@ -94,6 +94,6 @@ public function testIsVerifiable() ] ); $resource->verify(["amounts" => [1, 2]]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); + $this->assertInstanceOf(\Stripe\BankAccount::class, $resource); } } diff --git a/tests/Stripe/BitcoinReceiverTest.php b/tests/Stripe/BitcoinReceiverTest.php index cea999fc4..2da919259 100644 --- a/tests/Stripe/BitcoinReceiverTest.php +++ b/tests/Stripe/BitcoinReceiverTest.php @@ -47,7 +47,7 @@ public function testIsListable() ); $resources = BitcoinReceiver::all(); $this->assertTrue(is_array($resources->data)); - $this->assertSame("Stripe\\BitcoinReceiver", get_class($resources->data[0])); + $this->assertSame(\Stripe\BitcoinReceiver::class, get_class($resources->data[0])); } public function testIsRetrievable() @@ -57,6 +57,6 @@ public function testIsRetrievable() '/v1/bitcoin/receivers/' . self::TEST_RESOURCE_ID ); $resource = BitcoinReceiver::retrieve(self::TEST_RESOURCE_ID); - $this->assertSame("Stripe\\BitcoinReceiver", get_class($resource)); + $this->assertSame(\Stripe\BitcoinReceiver::class, get_class($resource)); } } diff --git a/tests/Stripe/CardTest.php b/tests/Stripe/CardTest.php index 8976eff66..ec19558f1 100644 --- a/tests/Stripe/CardTest.php +++ b/tests/Stripe/CardTest.php @@ -68,7 +68,7 @@ public function testIsSaveable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertSame("Stripe\\Card", get_class($resource)); + $this->assertSame(\Stripe\Card::class, get_class($resource)); } /** @@ -89,6 +89,6 @@ public function testIsDeletable() '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertSame("Stripe\\Card", get_class($resource)); + $this->assertSame(\Stripe\Card::class, get_class($resource)); } } diff --git a/tests/Stripe/ChargeTest.php b/tests/Stripe/ChargeTest.php index b8c6cbabf..f609b50b7 100644 --- a/tests/Stripe/ChargeTest.php +++ b/tests/Stripe/ChargeTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Charge::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Charge", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Charge::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/charges/' . self::TEST_RESOURCE_ID ); $resource = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); } public function testIsCreatable() @@ -38,7 +38,7 @@ public function testIsCreatable() "currency" => "usd", "source" => "tok_123" ]); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); } public function testIsSaveable() @@ -50,7 +50,7 @@ public function testIsSaveable() '/v1/charges/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); } public function testIsUpdatable() @@ -62,7 +62,7 @@ public function testIsUpdatable() $resource = Charge::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); } public function testCanRefund() @@ -73,7 +73,7 @@ public function testCanRefund() '/v1/charges/' . $charge->id . '/refund' ); $resource = $charge->refund(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); $this->assertSame($resource, $charge); } @@ -85,7 +85,7 @@ public function testCanCapture() '/v1/charges/' . $charge->id . '/capture' ); $resource = $charge->capture(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); $this->assertSame($resource, $charge); } @@ -97,7 +97,7 @@ public function testCanUpdateDispute() '/v1/charges/' . $charge->id . '/dispute' ); $resource = $charge->updateDispute(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); + $this->assertInstanceOf(\Stripe\Dispute::class, $resource); } public function testCanCloseDispute() @@ -108,7 +108,7 @@ public function testCanCloseDispute() '/v1/charges/' . $charge->id . '/dispute/close' ); $resource = $charge->closeDispute(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); $this->assertSame($resource, $charge); } @@ -121,7 +121,7 @@ public function testCanMarkAsFraudulent() ['fraud_details' => ['user_report' => 'fraudulent']] ); $resource = $charge->markAsFraudulent(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); $this->assertSame($resource, $charge); } @@ -134,7 +134,7 @@ public function testCanMarkAsSafe() ['fraud_details' => ['user_report' => 'safe']] ); $resource = $charge->markAsSafe(); - $this->assertInstanceOf("Stripe\\Charge", $resource); + $this->assertInstanceOf(\Stripe\Charge::class, $resource); $this->assertSame($resource, $charge); } } diff --git a/tests/Stripe/CountrySpecTest.php b/tests/Stripe/CountrySpecTest.php index cccd41168..c4ecd45f2 100644 --- a/tests/Stripe/CountrySpecTest.php +++ b/tests/Stripe/CountrySpecTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = CountrySpec::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\CountrySpec", $resources->data[0]); + $this->assertInstanceOf(\Stripe\CountrySpec::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,6 +24,6 @@ public function testIsRetrievable() '/v1/country_specs/' . self::TEST_RESOURCE_ID ); $resource = CountrySpec::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\CountrySpec", $resource); + $this->assertInstanceOf(\Stripe\CountrySpec::class, $resource); } } diff --git a/tests/Stripe/CouponTest.php b/tests/Stripe/CouponTest.php index 8a6fbf630..dfb274db0 100644 --- a/tests/Stripe/CouponTest.php +++ b/tests/Stripe/CouponTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Coupon::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Coupon", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Coupon::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/coupons/' . self::TEST_RESOURCE_ID ); $resource = Coupon::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Coupon", $resource); + $this->assertInstanceOf(\Stripe\Coupon::class, $resource); } public function testIsCreatable() @@ -39,7 +39,7 @@ public function testIsCreatable() "duration_in_months" => 3, "id" => self::TEST_RESOURCE_ID, ]); - $this->assertInstanceOf("Stripe\\Coupon", $resource); + $this->assertInstanceOf(\Stripe\Coupon::class, $resource); } public function testIsSaveable() @@ -51,7 +51,7 @@ public function testIsSaveable() '/v1/coupons/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertInstanceOf("Stripe\\Coupon", $resource); + $this->assertInstanceOf(\Stripe\Coupon::class, $resource); } public function testIsUpdatable() @@ -63,7 +63,7 @@ public function testIsUpdatable() $resource = Coupon::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Coupon", $resource); + $this->assertInstanceOf(\Stripe\Coupon::class, $resource); } public function testIsDeletable() @@ -74,6 +74,6 @@ public function testIsDeletable() '/v1/coupons/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Coupon", $resource); + $this->assertInstanceOf(\Stripe\Coupon::class, $resource); } } diff --git a/tests/Stripe/CustomerTest.php b/tests/Stripe/CustomerTest.php index e2af6215d..aa7e11c3b 100644 --- a/tests/Stripe/CustomerTest.php +++ b/tests/Stripe/CustomerTest.php @@ -15,7 +15,7 @@ public function testIsListable() ); $resources = Customer::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Customer", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Customer::class, $resources->data[0]); } public function testIsRetrievable() @@ -25,7 +25,7 @@ public function testIsRetrievable() '/v1/customers/' . self::TEST_RESOURCE_ID ); $resource = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Customer", $resource); + $this->assertInstanceOf(\Stripe\Customer::class, $resource); } public function testIsCreatable() @@ -35,7 +35,7 @@ public function testIsCreatable() '/v1/customers' ); $resource = Customer::create(); - $this->assertInstanceOf("Stripe\\Customer", $resource); + $this->assertInstanceOf(\Stripe\Customer::class, $resource); } public function testIsSaveable() @@ -47,7 +47,7 @@ public function testIsSaveable() '/v1/customers/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Customer", $resource); + $this->assertInstanceOf(\Stripe\Customer::class, $resource); } public function testIsUpdatable() @@ -59,7 +59,7 @@ public function testIsUpdatable() $resource = Customer::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Customer", $resource); + $this->assertInstanceOf(\Stripe\Customer::class, $resource); } public function testIsDeletable() @@ -70,7 +70,7 @@ public function testIsDeletable() '/v1/customers/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Customer", $resource); + $this->assertInstanceOf(\Stripe\Customer::class, $resource); } public function testCanAddInvoiceItem() @@ -89,7 +89,7 @@ public function testCanAddInvoiceItem() "amount" => 100, "currency" => "usd" ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } public function testCanListInvoices() @@ -102,7 +102,7 @@ public function testCanListInvoices() ); $resources = $customer->invoices(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Invoice", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Invoice::class, $resources->data[0]); } public function testCanListInvoiceItems() @@ -115,7 +115,7 @@ public function testCanListInvoiceItems() ); $resources = $customer->invoiceItems(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resources->data[0]); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resources->data[0]); } public function testCanListCharges() @@ -128,7 +128,7 @@ public function testCanListCharges() ); $resources = $customer->charges(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Charge", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Charge::class, $resources->data[0]); } public function testCanUpdateSubscription() @@ -146,7 +146,7 @@ public function testCanUpdateSubscription() ] ); $resource = $customer->updateSubscription(["plan" => "plan"]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); $this->assertSame("sub_foo", $customer->subscription->id); } @@ -165,7 +165,7 @@ public function testCanCancelSubscription() ] ); $resource = $customer->cancelSubscription(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); $this->assertSame("sub_foo", $customer->subscription->id); } @@ -206,7 +206,7 @@ public function testCanUpdateSource() ); $resource = Customer::updateSource(self::TEST_RESOURCE_ID, self::TEST_SOURCE_ID, ["name" => "name"]); // stripe-mock returns a Card on this method and not a bank account - $this->assertInstanceOf("Stripe\\Card", $resource); + $this->assertInstanceOf(\Stripe\Card::class, $resource); } public function testCanDeleteSource() diff --git a/tests/Stripe/DisputeTest.php b/tests/Stripe/DisputeTest.php index 81d93da02..67ddb1d80 100644 --- a/tests/Stripe/DisputeTest.php +++ b/tests/Stripe/DisputeTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Dispute::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Dispute", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Dispute::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/disputes/' . self::TEST_RESOURCE_ID ); $resource = Dispute::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Dispute", $resource); + $this->assertInstanceOf(\Stripe\Dispute::class, $resource); } public function testIsSaveable() @@ -36,7 +36,7 @@ public function testIsSaveable() '/v1/disputes/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); + $this->assertInstanceOf(\Stripe\Dispute::class, $resource); } public function testIsUpdatable() @@ -48,7 +48,7 @@ public function testIsUpdatable() $resource = Dispute::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Dispute", $resource); + $this->assertInstanceOf(\Stripe\Dispute::class, $resource); } public function testIsClosable() @@ -59,7 +59,7 @@ public function testIsClosable() '/v1/disputes/' . $dispute->id . '/close' ); $resource = $dispute->close(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); + $this->assertInstanceOf(\Stripe\Dispute::class, $resource); $this->assertSame($resource, $dispute); } } diff --git a/tests/Stripe/EphemeralKeyTest.php b/tests/Stripe/EphemeralKeyTest.php index e8a1fc0e9..b5196e2a6 100644 --- a/tests/Stripe/EphemeralKeyTest.php +++ b/tests/Stripe/EphemeralKeyTest.php @@ -15,7 +15,7 @@ public function testIsCreatable() $resource = EphemeralKey::create([ "customer" => "cus_123", ], ["stripe_version" => "2017-05-25"]); - $this->assertInstanceOf("Stripe\\EphemeralKey", $resource); + $this->assertInstanceOf(\Stripe\EphemeralKey::class, $resource); } /** @@ -38,6 +38,6 @@ public function testIsDeletable() '/v1/ephemeral_keys/' . $key->id ); $resource = $key->delete(); - $this->assertInstanceOf("Stripe\\EphemeralKey", $resource); + $this->assertInstanceOf(\Stripe\EphemeralKey::class, $resource); } } diff --git a/tests/Stripe/Error/BaseTest.php b/tests/Stripe/Error/BaseTest.php index 4c2732ed1..c86d9ab9b 100644 --- a/tests/Stripe/Error/BaseTest.php +++ b/tests/Stripe/Error/BaseTest.php @@ -6,7 +6,7 @@ class BaseTest extends TestCase { public function createFixture($params = []) { - return $this->getMockForAbstractClass('Stripe\\Error\\Base', [ + return $this->getMockForAbstractClass(\Stripe\Error\Base::class, [ 'message', 200, '{"key": "value"}', diff --git a/tests/Stripe/EventTest.php b/tests/Stripe/EventTest.php index 2e3c92f0e..4fdea6e63 100644 --- a/tests/Stripe/EventTest.php +++ b/tests/Stripe/EventTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Event::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Event", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Event::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,6 +24,6 @@ public function testIsRetrievable() '/v1/events/' . self::TEST_RESOURCE_ID ); $resource = Event::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Event", $resource); + $this->assertInstanceOf(\Stripe\Event::class, $resource); } } diff --git a/tests/Stripe/FileCreationTest.php b/tests/Stripe/FileCreationTest.php index 7da79054d..a4bd55e80 100644 --- a/tests/Stripe/FileCreationTest.php +++ b/tests/Stripe/FileCreationTest.php @@ -42,7 +42,7 @@ public function testIsCreatableWithFileHandle() "file" => $fp, "file_link_data" => ["create" => true] ]); - $this->assertInstanceOf("Stripe\\File", $resource); + $this->assertInstanceOf(\Stripe\File::class, $resource); } public function testIsCreatableWithCURLFile() @@ -61,6 +61,6 @@ public function testIsCreatableWithCURLFile() "file" => $curlFile, "file_link_data" => ["create" => true] ]); - $this->assertInstanceOf("Stripe\\File", $resource); + $this->assertInstanceOf(\Stripe\File::class, $resource); } } diff --git a/tests/Stripe/FileLinkTest.php b/tests/Stripe/FileLinkTest.php index 264d0f5ee..e70aaf658 100644 --- a/tests/Stripe/FileLinkTest.php +++ b/tests/Stripe/FileLinkTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = FileLink::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\FileLink", $resources->data[0]); + $this->assertInstanceOf(\Stripe\FileLink::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/file_links/' . self::TEST_RESOURCE_ID ); $resource = FileLink::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\FileLink", $resource); + $this->assertInstanceOf(\Stripe\FileLink::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = FileLink::create([ "file" => "file_123" ]); - $this->assertInstanceOf("Stripe\\FileLink", $resource); + $this->assertInstanceOf(\Stripe\FileLink::class, $resource); } public function testIsSaveable() @@ -48,7 +48,7 @@ public function testIsSaveable() '/v1/file_links/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\FileLink", $resource); + $this->assertInstanceOf(\Stripe\FileLink::class, $resource); } public function testIsUpdatable() @@ -60,6 +60,6 @@ public function testIsUpdatable() $resource = FileLink::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\FileLink", $resource); + $this->assertInstanceOf(\Stripe\FileLink::class, $resource); } } diff --git a/tests/Stripe/FileTest.php b/tests/Stripe/FileTest.php index 5ea89184c..621d2918e 100644 --- a/tests/Stripe/FileTest.php +++ b/tests/Stripe/FileTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = File::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\File", $resources->data[0]); + $this->assertInstanceOf(\Stripe\File::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/files/' . self::TEST_RESOURCE_ID ); $resource = File::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\File", $resource); + $this->assertInstanceOf(\Stripe\File::class, $resource); } public function testDeserializesFromFile() @@ -32,7 +32,7 @@ public function testDeserializesFromFile() $obj = Util\Util::convertToStripeObject([ 'object' => 'file', ], null); - $this->assertInstanceOf("Stripe\\File", $obj); + $this->assertInstanceOf(\Stripe\File::class, $obj); } public function testDeserializesFromFileUpload() @@ -40,6 +40,6 @@ public function testDeserializesFromFileUpload() $obj = Util\Util::convertToStripeObject([ 'object' => 'file_upload', ], null); - $this->assertInstanceOf("Stripe\\File", $obj); + $this->assertInstanceOf(\Stripe\File::class, $obj); } } diff --git a/tests/Stripe/InvoiceItemTest.php b/tests/Stripe/InvoiceItemTest.php index ffe140aa7..d528da902 100644 --- a/tests/Stripe/InvoiceItemTest.php +++ b/tests/Stripe/InvoiceItemTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = InvoiceItem::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resources->data[0]); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/invoiceitems/' . self::TEST_RESOURCE_ID ); $resource = InvoiceItem::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } public function testIsCreatable() @@ -38,7 +38,7 @@ public function testIsCreatable() "currency" => "usd", "customer" => "cus_123" ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } public function testIsSaveable() @@ -50,7 +50,7 @@ public function testIsSaveable() '/v1/invoiceitems/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } public function testIsUpdatable() @@ -62,7 +62,7 @@ public function testIsUpdatable() $resource = InvoiceItem::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } public function testIsDeletable() @@ -73,6 +73,6 @@ public function testIsDeletable() '/v1/invoiceitems/' . $invoiceItem->id ); $resource = $invoiceItem->delete(); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); + $this->assertInstanceOf(\Stripe\InvoiceItem::class, $resource); } } diff --git a/tests/Stripe/InvoiceTest.php b/tests/Stripe/InvoiceTest.php index 578b551a1..36c28012e 100644 --- a/tests/Stripe/InvoiceTest.php +++ b/tests/Stripe/InvoiceTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Invoice::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Invoice", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Invoice::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/invoices/' . self::TEST_RESOURCE_ID ); $resource = Invoice::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = Invoice::create([ "customer" => "cus_123" ]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testIsSaveable() @@ -48,7 +48,7 @@ public function testIsSaveable() '/v1/invoices/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testIsUpdatable() @@ -60,7 +60,7 @@ public function testIsUpdatable() $resource = Invoice::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testIsDeletable() @@ -71,7 +71,7 @@ public function testIsDeletable() '/v1/invoices/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testCanFinalizeInvoice() @@ -82,7 +82,7 @@ public function testCanFinalizeInvoice() '/v1/invoices/' . $invoice->id . '/finalize' ); $resource = $invoice->finalizeInvoice(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); $this->assertSame($resource, $invoice); } @@ -94,7 +94,7 @@ public function testCanMarkUncollectible() '/v1/invoices/' . $invoice->id . '/mark_uncollectible' ); $resource = $invoice->markUncollectible(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); $this->assertSame($resource, $invoice); } @@ -106,7 +106,7 @@ public function testCanPay() '/v1/invoices/' . $invoice->id . '/pay' ); $resource = $invoice->pay(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); $this->assertSame($resource, $invoice); } @@ -117,7 +117,7 @@ public function testCanRetrieveUpcoming() '/v1/invoices/upcoming' ); $resource = Invoice::upcoming(["customer" => "cus_123"]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); } public function testCanSendInvoice() @@ -128,7 +128,7 @@ public function testCanSendInvoice() '/v1/invoices/' . $invoice->id . '/send' ); $resource = $invoice->sendInvoice(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); $this->assertSame($resource, $invoice); } @@ -140,7 +140,7 @@ public function testCanVoidInvoice() '/v1/invoices/' . $invoice->id . '/void' ); $resource = $invoice->voidInvoice(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); + $this->assertInstanceOf(\Stripe\Invoice::class, $resource); $this->assertSame($resource, $invoice); } } diff --git a/tests/Stripe/IssuerFraudRecordTest.php b/tests/Stripe/IssuerFraudRecordTest.php index 1869248a1..5bcaec745 100644 --- a/tests/Stripe/IssuerFraudRecordTest.php +++ b/tests/Stripe/IssuerFraudRecordTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = IssuerFraudRecord::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resources->data[0]); + $this->assertInstanceOf(\Stripe\IssuerFraudRecord::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,6 +24,6 @@ public function testIsRetrievable() '/v1/issuer_fraud_records/' . self::TEST_RESOURCE_ID ); $resource = IssuerFraudRecord::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resource); + $this->assertInstanceOf(\Stripe\IssuerFraudRecord::class, $resource); } } diff --git a/tests/Stripe/OrderReturnTest.php b/tests/Stripe/OrderReturnTest.php index bb2d65c43..c0aa0e115 100644 --- a/tests/Stripe/OrderReturnTest.php +++ b/tests/Stripe/OrderReturnTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = OrderReturn::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\OrderReturn", $resources->data[0]); + $this->assertInstanceOf(\Stripe\OrderReturn::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,6 +24,6 @@ public function testIsRetrievable() '/v1/order_returns/' . self::TEST_RESOURCE_ID ); $resource = OrderReturn::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\OrderReturn", $resource); + $this->assertInstanceOf(\Stripe\OrderReturn::class, $resource); } } diff --git a/tests/Stripe/OrderTest.php b/tests/Stripe/OrderTest.php index 51d17e94f..f13ed04b6 100644 --- a/tests/Stripe/OrderTest.php +++ b/tests/Stripe/OrderTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Order::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Order", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Order::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/orders/' . self::TEST_RESOURCE_ID ); $resource = Order::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Order", $resource); + $this->assertInstanceOf(\Stripe\Order::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = Order::create([ 'currency' => 'usd' ]); - $this->assertInstanceOf("Stripe\\Order", $resource); + $this->assertInstanceOf(\Stripe\Order::class, $resource); } public function testIsSaveable() @@ -48,7 +48,7 @@ public function testIsSaveable() '/v1/orders/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Order", $resource); + $this->assertInstanceOf(\Stripe\Order::class, $resource); } public function testIsUpdatable() @@ -60,7 +60,7 @@ public function testIsUpdatable() $resource = Order::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Order", $resource); + $this->assertInstanceOf(\Stripe\Order::class, $resource); } public function testIsPayable() @@ -71,7 +71,7 @@ public function testIsPayable() '/v1/orders/' . $resource->id . '/pay' ); $resource->pay(); - $this->assertInstanceOf("Stripe\\Order", $resource); + $this->assertInstanceOf(\Stripe\Order::class, $resource); } public function testIsReturnable() @@ -82,6 +82,6 @@ public function testIsReturnable() '/v1/orders/' . $order->id . '/returns' ); $resource = $order->returnOrder(); - $this->assertInstanceOf("Stripe\\OrderReturn", $resource); + $this->assertInstanceOf(\Stripe\OrderReturn::class, $resource); } } diff --git a/tests/Stripe/PaymentIntentTest.php b/tests/Stripe/PaymentIntentTest.php index 5a883da37..3eaed9a4b 100644 --- a/tests/Stripe/PaymentIntentTest.php +++ b/tests/Stripe/PaymentIntentTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = PaymentIntent::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resources->data[0]); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/payment_intents/' . self::TEST_RESOURCE_ID ); $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsCreatable() @@ -38,7 +38,7 @@ public function testIsCreatable() "currency" => "usd", 'payment_method_types' => ['card'], ]); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsSaveable() @@ -50,7 +50,7 @@ public function testIsSaveable() '/v1/payment_intents/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsUpdatable() @@ -65,7 +65,7 @@ public function testIsUpdatable() "metadata" => ["key" => "value"], ] ); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsCancelable() @@ -76,7 +76,7 @@ public function testIsCancelable() '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/cancel' ); $resource->cancel(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsCapturable() @@ -87,7 +87,7 @@ public function testIsCapturable() '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/capture' ); $resource->capture(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } public function testIsConfirmable() @@ -98,6 +98,6 @@ public function testIsConfirmable() '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/confirm' ); $resource->confirm(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); + $this->assertInstanceOf(\Stripe\PaymentIntent::class, $resource); } } diff --git a/tests/Stripe/PaymentMethodTest.php b/tests/Stripe/PaymentMethodTest.php index 0280cfb23..89db89af8 100644 --- a/tests/Stripe/PaymentMethodTest.php +++ b/tests/Stripe/PaymentMethodTest.php @@ -17,7 +17,7 @@ public function testIsListable() 'type' => 'card', ]); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resources->data[0]); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resources->data[0]); } public function testIsRetrievable() @@ -27,7 +27,7 @@ public function testIsRetrievable() '/v1/payment_methods/' . self::TEST_RESOURCE_ID ); $resource = PaymentMethod::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); } public function testIsCreatable() @@ -39,7 +39,7 @@ public function testIsCreatable() $resource = PaymentMethod::create([ 'type' => 'card', ]); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); } public function testIsSaveable() @@ -51,7 +51,7 @@ public function testIsSaveable() '/v1/payment_methods/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); } public function testIsUpdatable() @@ -63,7 +63,7 @@ public function testIsUpdatable() $resource = PaymentMethod::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); } public function testCanAttach() @@ -76,7 +76,7 @@ public function testCanAttach() $resource = $resource->attach([ 'customer' => 'cus_123', ]); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); $this->assertSame($resource, $resource); } @@ -88,7 +88,7 @@ public function testCanDetach() '/v1/payment_methods/' . $resource->id . '/detach' ); $resource = $resource->detach(); - $this->assertInstanceOf("Stripe\\PaymentMethod", $resource); + $this->assertInstanceOf(\Stripe\PaymentMethod::class, $resource); $this->assertSame($resource, $resource); } } diff --git a/tests/Stripe/PayoutTest.php b/tests/Stripe/PayoutTest.php index 79c7b5fd0..648947636 100644 --- a/tests/Stripe/PayoutTest.php +++ b/tests/Stripe/PayoutTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Payout::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Payout", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Payout::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/payouts/' . self::TEST_RESOURCE_ID ); $resource = Payout::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Payout", $resource); + $this->assertInstanceOf(\Stripe\Payout::class, $resource); } public function testIsCreatable() @@ -37,7 +37,7 @@ public function testIsCreatable() "amount" => 100, "currency" => "usd" ]); - $this->assertInstanceOf("Stripe\\Payout", $resource); + $this->assertInstanceOf(\Stripe\Payout::class, $resource); } public function testIsSaveable() @@ -49,7 +49,7 @@ public function testIsSaveable() '/v1/payouts/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Payout", $resource); + $this->assertInstanceOf(\Stripe\Payout::class, $resource); } public function testIsUpdatable() @@ -61,7 +61,7 @@ public function testIsUpdatable() $resource = Payout::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Payout", $resource); + $this->assertInstanceOf(\Stripe\Payout::class, $resource); } public function testIsCancelable() @@ -72,6 +72,6 @@ public function testIsCancelable() '/v1/payouts/' . $resource->id . '/cancel' ); $resource->cancel(); - $this->assertInstanceOf("Stripe\\Payout", $resource); + $this->assertInstanceOf(\Stripe\Payout::class, $resource); } } diff --git a/tests/Stripe/PersonTest.php b/tests/Stripe/PersonTest.php index 74c9c3403..fa5a10356 100644 --- a/tests/Stripe/PersonTest.php +++ b/tests/Stripe/PersonTest.php @@ -33,7 +33,7 @@ public function testIsSaveable() '/v1/accounts/' . self::TEST_ACCOUNT_ID . '/persons/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertSame("Stripe\\Person", get_class($resource)); + $this->assertSame(\Stripe\Person::class, get_class($resource)); } /** @@ -54,6 +54,6 @@ public function testIsDeletable() '/v1/accounts/' . self::TEST_ACCOUNT_ID . '/persons/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertSame("Stripe\\Person", get_class($resource)); + $this->assertSame(\Stripe\Person::class, get_class($resource)); } } diff --git a/tests/Stripe/PlanTest.php b/tests/Stripe/PlanTest.php index 9c33b4174..c87a42429 100644 --- a/tests/Stripe/PlanTest.php +++ b/tests/Stripe/PlanTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Plan::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Plan", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Plan::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/plans/' . self::TEST_RESOURCE_ID ); $resource = Plan::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Plan", $resource); + $this->assertInstanceOf(\Stripe\Plan::class, $resource); } public function testIsCreatable() @@ -40,7 +40,7 @@ public function testIsCreatable() 'nickname' => self::TEST_RESOURCE_ID, 'id' => self::TEST_RESOURCE_ID ]); - $this->assertInstanceOf("Stripe\\Plan", $resource); + $this->assertInstanceOf(\Stripe\Plan::class, $resource); } public function testIsSaveable() @@ -52,7 +52,7 @@ public function testIsSaveable() '/v1/plans/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Plan", $resource); + $this->assertInstanceOf(\Stripe\Plan::class, $resource); } public function testIsUpdatable() @@ -64,7 +64,7 @@ public function testIsUpdatable() $resource = Plan::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Plan", $resource); + $this->assertInstanceOf(\Stripe\Plan::class, $resource); } public function testIsDeletable() @@ -75,6 +75,6 @@ public function testIsDeletable() '/v1/plans/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Plan", $resource); + $this->assertInstanceOf(\Stripe\Plan::class, $resource); } } diff --git a/tests/Stripe/ProductTest.php b/tests/Stripe/ProductTest.php index c2a3813c8..47854ee33 100644 --- a/tests/Stripe/ProductTest.php +++ b/tests/Stripe/ProductTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Product::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Product", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Product::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/products/' . self::TEST_RESOURCE_ID ); $resource = Product::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Product", $resource); + $this->assertInstanceOf(\Stripe\Product::class, $resource); } public function testIsCreatable() @@ -37,7 +37,7 @@ public function testIsCreatable() 'name' => 'name', 'type' => 'good' ]); - $this->assertInstanceOf("Stripe\\Product", $resource); + $this->assertInstanceOf(\Stripe\Product::class, $resource); } public function testIsSaveable() @@ -49,7 +49,7 @@ public function testIsSaveable() '/v1/products/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Product", $resource); + $this->assertInstanceOf(\Stripe\Product::class, $resource); } public function testIsUpdatable() @@ -61,7 +61,7 @@ public function testIsUpdatable() $resource = Product::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Product", $resource); + $this->assertInstanceOf(\Stripe\Product::class, $resource); } public function testIsDeletable() @@ -72,6 +72,6 @@ public function testIsDeletable() '/v1/products/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Product", $resource); + $this->assertInstanceOf(\Stripe\Product::class, $resource); } } diff --git a/tests/Stripe/Radar/ValueListTest.php b/tests/Stripe/Radar/ValueListTest.php index 214e13e90..5c3ef1115 100644 --- a/tests/Stripe/Radar/ValueListTest.php +++ b/tests/Stripe/Radar/ValueListTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = ValueList::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/radar/value_lists/' . self::TEST_RESOURCE_ID ); $resource = ValueList::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resource); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resource); } public function testIsCreatable() @@ -37,7 +37,7 @@ public function testIsCreatable() "alias" => "alias", "name" => "name", ]); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resource); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resource); } public function testIsSaveable() @@ -49,7 +49,7 @@ public function testIsSaveable() '/v1/radar/value_lists/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resource); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resource); } public function testIsUpdatable() @@ -61,7 +61,7 @@ public function testIsUpdatable() $resource = ValueList::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resource); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resource); } public function testIsDeletable() @@ -72,6 +72,6 @@ public function testIsDeletable() '/v1/radar/value_lists/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Radar\\ValueList", $resource); + $this->assertInstanceOf(\Stripe\Radar\ValueList::class, $resource); } } diff --git a/tests/Stripe/RecipientTest.php b/tests/Stripe/RecipientTest.php index 67866721f..cc7f1c7ba 100644 --- a/tests/Stripe/RecipientTest.php +++ b/tests/Stripe/RecipientTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Recipient::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Recipient", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Recipient::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/recipients/' . self::TEST_RESOURCE_ID ); $resource = Recipient::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Recipient", $resource); + $this->assertInstanceOf(\Stripe\Recipient::class, $resource); } public function testIsCreatable() @@ -37,7 +37,7 @@ public function testIsCreatable() "name" => "name", "type" => "individual" ]); - $this->assertInstanceOf("Stripe\\Recipient", $resource); + $this->assertInstanceOf(\Stripe\Recipient::class, $resource); } public function testIsSaveable() @@ -49,7 +49,7 @@ public function testIsSaveable() '/v1/recipients/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Recipient", $resource); + $this->assertInstanceOf(\Stripe\Recipient::class, $resource); } public function testIsUpdatable() @@ -61,7 +61,7 @@ public function testIsUpdatable() $resource = Recipient::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Recipient", $resource); + $this->assertInstanceOf(\Stripe\Recipient::class, $resource); } public function testIsDeletable() @@ -72,7 +72,7 @@ public function testIsDeletable() '/v1/recipients/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Recipient", $resource); + $this->assertInstanceOf(\Stripe\Recipient::class, $resource); } public function testCanListTransfers() @@ -93,6 +93,6 @@ public function testCanListTransfers() ); $resources = $recipient->transfers(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Transfer", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Transfer::class, $resources->data[0]); } } diff --git a/tests/Stripe/RefundTest.php b/tests/Stripe/RefundTest.php index 788361d4d..96e8e6ed1 100644 --- a/tests/Stripe/RefundTest.php +++ b/tests/Stripe/RefundTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Refund::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Refund", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Refund::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/refunds/' . self::TEST_RESOURCE_ID ); $resource = Refund::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Refund", $resource); + $this->assertInstanceOf(\Stripe\Refund::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = Refund::create([ "charge" => "ch_123" ]); - $this->assertInstanceOf("Stripe\\Refund", $resource); + $this->assertInstanceOf(\Stripe\Refund::class, $resource); } public function testIsSaveable() @@ -48,7 +48,7 @@ public function testIsSaveable() '/v1/refunds/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Refund", $resource); + $this->assertInstanceOf(\Stripe\Refund::class, $resource); } public function testIsUpdatable() @@ -60,6 +60,6 @@ public function testIsUpdatable() $resource = Refund::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Refund", $resource); + $this->assertInstanceOf(\Stripe\Refund::class, $resource); } } diff --git a/tests/Stripe/ReviewTest.php b/tests/Stripe/ReviewTest.php index 7c82c21c0..82b9673de 100644 --- a/tests/Stripe/ReviewTest.php +++ b/tests/Stripe/ReviewTest.php @@ -14,7 +14,7 @@ public function testIsApprovable() '/v1/reviews/' . self::TEST_RESOURCE_ID . '/approve' ); $resource->approve(); - $this->assertInstanceOf("Stripe\\Review", $resource); + $this->assertInstanceOf(\Stripe\Review::class, $resource); } public function testIsListable() @@ -25,7 +25,7 @@ public function testIsListable() ); $resources = Review::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Review", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Review::class, $resources->data[0]); } public function testIsRetrievable() @@ -35,6 +35,6 @@ public function testIsRetrievable() '/v1/reviews/' . self::TEST_RESOURCE_ID ); $resource = Review::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Review", $resource); + $this->assertInstanceOf(\Stripe\Review::class, $resource); } } diff --git a/tests/Stripe/SKUTest.php b/tests/Stripe/SKUTest.php index d4fc2ad40..584c37cfe 100644 --- a/tests/Stripe/SKUTest.php +++ b/tests/Stripe/SKUTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = SKU::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SKU", $resources->data[0]); + $this->assertInstanceOf(\Stripe\SKU::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/skus/' . self::TEST_RESOURCE_ID ); $resource = SKU::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\SKU", $resource); + $this->assertInstanceOf(\Stripe\SKU::class, $resource); } public function testIsCreatable() @@ -42,7 +42,7 @@ public function testIsCreatable() 'price' => 100, 'product' => "prod_123" ]); - $this->assertInstanceOf("Stripe\\SKU", $resource); + $this->assertInstanceOf(\Stripe\SKU::class, $resource); } public function testIsSaveable() @@ -54,7 +54,7 @@ public function testIsSaveable() '/v1/skus/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\SKU", $resource); + $this->assertInstanceOf(\Stripe\SKU::class, $resource); } public function testIsUpdatable() @@ -66,7 +66,7 @@ public function testIsUpdatable() $resource = SKU::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\SKU", $resource); + $this->assertInstanceOf(\Stripe\SKU::class, $resource); } public function testIsDeletable() @@ -77,6 +77,6 @@ public function testIsDeletable() '/v1/skus/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\SKU", $resource); + $this->assertInstanceOf(\Stripe\SKU::class, $resource); } } diff --git a/tests/Stripe/SourceTest.php b/tests/Stripe/SourceTest.php index ad11b0d34..04efc8e02 100644 --- a/tests/Stripe/SourceTest.php +++ b/tests/Stripe/SourceTest.php @@ -13,7 +13,7 @@ public function testIsRetrievable() '/v1/sources/' . self::TEST_RESOURCE_ID ); $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } public function testIsCreatable() @@ -25,7 +25,7 @@ public function testIsCreatable() $resource = Source::create([ "type" => "card" ]); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } public function testIsSaveable() @@ -37,7 +37,7 @@ public function testIsSaveable() '/v1/sources/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } public function testIsUpdatable() @@ -49,7 +49,7 @@ public function testIsUpdatable() $resource = Source::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } public function testCanSaveCardExpiryDate() @@ -97,7 +97,7 @@ public function testIsDetachableWhenAttached() '/v1/customers/cus_123/sources/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } /** @@ -118,7 +118,7 @@ public function testCanListSourceTransactions() ); $resources = $source->sourceTransactions(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SourceTransaction", $resources->data[0]); + $this->assertInstanceOf(\Stripe\SourceTransaction::class, $resources->data[0]); } public function testCanVerify() @@ -129,6 +129,6 @@ public function testCanVerify() '/v1/sources/' . $resource->id . "/verify" ); $resource->verify(["values" => [32, 45]]); - $this->assertInstanceOf("Stripe\\Source", $resource); + $this->assertInstanceOf(\Stripe\Source::class, $resource); } } diff --git a/tests/Stripe/StripeObjectTest.php b/tests/Stripe/StripeObjectTest.php index bbf2d7c5a..9f245afa8 100644 --- a/tests/Stripe/StripeObjectTest.php +++ b/tests/Stripe/StripeObjectTest.php @@ -13,11 +13,11 @@ public function setUpReflectors() // private attributes. // This is used to invoke the `deepCopy` protected function - $this->deepCopyReflector = new \ReflectionMethod('Stripe\\StripeObject', 'deepCopy'); + $this->deepCopyReflector = new \ReflectionMethod(\Stripe\StripeObject::class, 'deepCopy'); $this->deepCopyReflector->setAccessible(true); // This is used to access the `_opts` protected variable - $this->optsReflector = new \ReflectionProperty('Stripe\\StripeObject', '_opts'); + $this->optsReflector = new \ReflectionProperty(\Stripe\StripeObject::class, '_opts'); $this->optsReflector->setAccessible(true); } @@ -480,7 +480,7 @@ public function testDeserializeEmptyMetadata() 'metadata' => [], ]); - $this->assertInstanceOf("Stripe\\StripeObject", $obj->metadata); + $this->assertInstanceOf(\Stripe\StripeObject::class, $obj->metadata); } public function testDeserializeMetadataWithKeyNamedMetadata() @@ -489,7 +489,7 @@ public function testDeserializeMetadataWithKeyNamedMetadata() 'metadata' => ['metadata' => 'value'], ]); - $this->assertInstanceOf("Stripe\\StripeObject", $obj->metadata); + $this->assertInstanceOf(\Stripe\StripeObject::class, $obj->metadata); $this->assertEquals("value", $obj->metadata->metadata); } } diff --git a/tests/Stripe/SubscriptionItemTest.php b/tests/Stripe/SubscriptionItemTest.php index 2432820fd..15a496c65 100644 --- a/tests/Stripe/SubscriptionItemTest.php +++ b/tests/Stripe/SubscriptionItemTest.php @@ -19,7 +19,7 @@ public function testIsListable() "subscription" => "sub_123" ]); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resources->data[0]); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resources->data[0]); } public function testIsRetrievable() @@ -29,7 +29,7 @@ public function testIsRetrievable() '/v1/subscription_items/' . self::TEST_RESOURCE_ID ); $resource = SubscriptionItem::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resource); } public function testIsCreatable() @@ -42,7 +42,7 @@ public function testIsCreatable() "plan" => "plan", "subscription" => "sub_123" ]); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resource); } public function testIsSaveable() @@ -54,7 +54,7 @@ public function testIsSaveable() '/v1/subscription_items/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resource); } public function testIsUpdatable() @@ -66,7 +66,7 @@ public function testIsUpdatable() $resource = SubscriptionItem::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resource); } public function testIsDeletable() @@ -77,7 +77,7 @@ public function testIsDeletable() '/v1/subscription_items/' . $resource->id ); $resource->delete(); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionItem::class, $resource); } public function testCanListUsageRecordSummaries() @@ -89,6 +89,6 @@ public function testCanListUsageRecordSummaries() ); $resources = $resource->usageRecordSummaries(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\UsageRecordSummary", $resources->data[0]); + $this->assertInstanceOf(\Stripe\UsageRecordSummary::class, $resources->data[0]); } } diff --git a/tests/Stripe/SubscriptionScheduleTest.php b/tests/Stripe/SubscriptionScheduleTest.php index c6b20cc6d..9b4c5e3bf 100644 --- a/tests/Stripe/SubscriptionScheduleTest.php +++ b/tests/Stripe/SubscriptionScheduleTest.php @@ -15,7 +15,7 @@ public function testIsListable() ); $resources = SubscriptionSchedule::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resources->data[0]); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resources->data[0]); } public function testIsRetrievable() @@ -25,7 +25,7 @@ public function testIsRetrievable() '/v1/subscription_schedules/' . self::TEST_RESOURCE_ID ); $resource = SubscriptionSchedule::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testIsCreatable() @@ -43,7 +43,7 @@ public function testIsCreatable() ], ], ]); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testIsSaveable() @@ -55,7 +55,7 @@ public function testIsSaveable() '/v1/subscription_schedules/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testIsUpdatable() @@ -67,7 +67,7 @@ public function testIsUpdatable() $resource = SubscriptionSchedule::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testIsCancelable() @@ -79,7 +79,7 @@ public function testIsCancelable() [] ); $resource->cancel([]); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testIsReleaseable() @@ -91,7 +91,7 @@ public function testIsReleaseable() [] ); $resource->release([]); - $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionSchedule::class, $resource); } public function testRevisions() @@ -103,7 +103,7 @@ public function testRevisions() ); $revisions = $schedule->revisions(); $this->assertTrue(is_array($revisions->data)); - $this->assertInstanceOf("Stripe\\SubscriptionScheduleRevision", $revisions->data[0]); + $this->assertInstanceOf(\Stripe\SubscriptionScheduleRevision::class, $revisions->data[0]); } public function testCanRetrieveRevision() @@ -113,7 +113,7 @@ public function testCanRetrieveRevision() '/v1/subscription_schedules/' . self::TEST_RESOURCE_ID . '/revisions/' . self::TEST_REVISION_ID ); $resource = SubscriptionSchedule::retrieveRevision(self::TEST_RESOURCE_ID, self::TEST_REVISION_ID); - $this->assertInstanceOf("Stripe\\SubscriptionScheduleRevision", $resource); + $this->assertInstanceOf(\Stripe\SubscriptionScheduleRevision::class, $resource); } public function testCanListRevisions() diff --git a/tests/Stripe/SubscriptionTest.php b/tests/Stripe/SubscriptionTest.php index 59b92e8fc..422056201 100644 --- a/tests/Stripe/SubscriptionTest.php +++ b/tests/Stripe/SubscriptionTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Subscription::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Subscription", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Subscription::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/subscriptions/' . self::TEST_RESOURCE_ID ); $resource = Subscription::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testIsCreatable() @@ -36,7 +36,7 @@ public function testIsCreatable() $resource = Subscription::create([ "customer" => "cus_123" ]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testIsSaveable() @@ -48,7 +48,7 @@ public function testIsSaveable() '/v1/subscriptions/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testIsUpdatable() @@ -60,7 +60,7 @@ public function testIsUpdatable() $resource = Subscription::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testIsCancelable() @@ -72,7 +72,7 @@ public function testIsCancelable() [] ); $resource->cancel([]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testCanDeleteDiscount() @@ -83,7 +83,7 @@ public function testCanDeleteDiscount() '/v1/subscriptions/' . $resource->id . '/discount' ); $resource->deleteDiscount(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); + $this->assertInstanceOf(\Stripe\Subscription::class, $resource); } public function testSerializeParametersItems() diff --git a/tests/Stripe/ThreeDSecureTest.php b/tests/Stripe/ThreeDSecureTest.php index f56e649cb..4e304fb7b 100644 --- a/tests/Stripe/ThreeDSecureTest.php +++ b/tests/Stripe/ThreeDSecureTest.php @@ -13,7 +13,7 @@ public function testIsRetrievable() '/v1/3d_secure/' . self::TEST_RESOURCE_ID ); $resource = ThreeDSecure::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ThreeDSecure", $resource); + $this->assertInstanceOf(\Stripe\ThreeDSecure::class, $resource); } public function testIsCreatable() @@ -27,6 +27,6 @@ public function testIsCreatable() "currency" => "usd", "return_url" => "url" ]); - $this->assertInstanceOf("Stripe\\ThreeDSecure", $resource); + $this->assertInstanceOf(\Stripe\ThreeDSecure::class, $resource); } } diff --git a/tests/Stripe/TokenTest.php b/tests/Stripe/TokenTest.php index 36bb4bc82..7b1b781f6 100644 --- a/tests/Stripe/TokenTest.php +++ b/tests/Stripe/TokenTest.php @@ -13,7 +13,7 @@ public function testIsRetrievable() '/v1/tokens/' . self::TEST_RESOURCE_ID ); $resource = Token::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Token", $resource); + $this->assertInstanceOf(\Stripe\Token::class, $resource); } public function testIsCreatable() @@ -23,6 +23,6 @@ public function testIsCreatable() '/v1/tokens' ); $resource = Token::create(["card" => "tok_visa"]); - $this->assertInstanceOf("Stripe\\Token", $resource); + $this->assertInstanceOf(\Stripe\Token::class, $resource); } } diff --git a/tests/Stripe/TopupTest.php b/tests/Stripe/TopupTest.php index 9990b30ed..fe4001847 100644 --- a/tests/Stripe/TopupTest.php +++ b/tests/Stripe/TopupTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Topup::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Topup", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Topup::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/topups/' . self::TEST_RESOURCE_ID ); $resource = Topup::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Topup", $resource); + $this->assertInstanceOf(\Stripe\Topup::class, $resource); } public function testIsCreatable() @@ -40,7 +40,7 @@ public function testIsCreatable() "description" => "description", "statement_descriptor" => "statement descriptor" ]); - $this->assertInstanceOf("Stripe\\Topup", $resource); + $this->assertInstanceOf(\Stripe\Topup::class, $resource); } public function testIsSaveable() @@ -52,7 +52,7 @@ public function testIsSaveable() '/v1/topups/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Topup", $resource); + $this->assertInstanceOf(\Stripe\Topup::class, $resource); } public function testIsUpdatable() @@ -64,7 +64,7 @@ public function testIsUpdatable() $resource = Topup::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Topup", $resource); + $this->assertInstanceOf(\Stripe\Topup::class, $resource); } public function testIsCancelable() @@ -75,6 +75,6 @@ public function testIsCancelable() '/v1/topups/' . self::TEST_RESOURCE_ID . '/cancel' ); $resource = $resource->cancel(); - $this->assertInstanceOf("Stripe\\Topup", $resource); + $this->assertInstanceOf(\Stripe\Topup::class, $resource); } } diff --git a/tests/Stripe/TransferReversalTest.php b/tests/Stripe/TransferReversalTest.php index 37101c732..21e9986ef 100644 --- a/tests/Stripe/TransferReversalTest.php +++ b/tests/Stripe/TransferReversalTest.php @@ -16,6 +16,6 @@ public function testIsSaveable() '/v1/transfers/' . $resource->transfer . '/reversals/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); + $this->assertInstanceOf(\Stripe\TransferReversal::class, $resource); } } diff --git a/tests/Stripe/TransferTest.php b/tests/Stripe/TransferTest.php index d60d560e7..e561ba701 100644 --- a/tests/Stripe/TransferTest.php +++ b/tests/Stripe/TransferTest.php @@ -15,7 +15,7 @@ public function testIsListable() ); $resources = Transfer::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Transfer", $resources->data[0]); + $this->assertInstanceOf(\Stripe\Transfer::class, $resources->data[0]); } public function testIsRetrievable() @@ -25,7 +25,7 @@ public function testIsRetrievable() '/v1/transfers/' . self::TEST_RESOURCE_ID ); $resource = Transfer::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); } public function testIsCreatable() @@ -39,7 +39,7 @@ public function testIsCreatable() "currency" => "usd", "destination" => "acct_123" ]); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); } public function testIsSaveable() @@ -51,7 +51,7 @@ public function testIsSaveable() '/v1/transfers/' . $resource->id ); $resource->save(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); } public function testIsUpdatable() @@ -63,7 +63,7 @@ public function testIsUpdatable() $resource = Transfer::update(self::TEST_RESOURCE_ID, [ "metadata" => ["key" => "value"], ]); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); } public function testIsReversable() @@ -74,7 +74,7 @@ public function testIsReversable() '/v1/transfers/' . $resource->id . '/reversals' ); $resource->reverse(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); } public function testIsCancelable() @@ -87,7 +87,7 @@ public function testIsCancelable() '/v1/transfers/' . $transfer->id . '/cancel' ); $resource = $transfer->cancel(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); + $this->assertInstanceOf(\Stripe\Transfer::class, $resource); $this->assertSame($resource, $transfer); } @@ -98,7 +98,7 @@ public function testCanCreateReversal() '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals' ); $resource = Transfer::createReversal(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); + $this->assertInstanceOf(\Stripe\TransferReversal::class, $resource); } public function testCanRetrieveReversal() @@ -108,7 +108,7 @@ public function testCanRetrieveReversal() '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals/' . self::TEST_REVERSAL_ID ); $resource = Transfer::retrieveReversal(self::TEST_RESOURCE_ID, self::TEST_REVERSAL_ID); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); + $this->assertInstanceOf(\Stripe\TransferReversal::class, $resource); } public function testCanUpdateReversal() @@ -124,7 +124,7 @@ public function testCanUpdateReversal() "metadata" => ["key" => "value"], ] ); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); + $this->assertInstanceOf(\Stripe\TransferReversal::class, $resource); } public function testCanListReversal() @@ -135,6 +135,6 @@ public function testCanListReversal() ); $resources = Transfer::allReversals(self::TEST_RESOURCE_ID); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\TransferReversal", $resources->data[0]); + $this->assertInstanceOf(\Stripe\TransferReversal::class, $resources->data[0]); } } diff --git a/tests/Stripe/UsageRecordTest.php b/tests/Stripe/UsageRecordTest.php index c5fe37306..efff6d884 100644 --- a/tests/Stripe/UsageRecordTest.php +++ b/tests/Stripe/UsageRecordTest.php @@ -18,7 +18,7 @@ public function testIsCreatable() 'timestamp' => 12341234, 'action' => 'set' ]); - $this->assertInstanceOf("Stripe\\UsageRecord", $resource); + $this->assertInstanceOf(\Stripe\UsageRecord::class, $resource); } /** diff --git a/tests/Stripe/WebhookEndpointTest.php b/tests/Stripe/WebhookEndpointTest.php index e01828ad4..bba535201 100644 --- a/tests/Stripe/WebhookEndpointTest.php +++ b/tests/Stripe/WebhookEndpointTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = WebhookEndpoint::all(); $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resources->data[0]); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resources->data[0]); } public function testIsRetrievable() @@ -24,7 +24,7 @@ public function testIsRetrievable() '/v1/webhook_endpoints/' . self::TEST_RESOURCE_ID ); $resource = WebhookEndpoint::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resource); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resource); } public function testIsCreatable() @@ -37,7 +37,7 @@ public function testIsCreatable() 'enabled_events' => ['charge.succeeded'], 'url' => 'https://stripe.com', ]); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resource); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resource); } public function testIsSaveable() @@ -49,7 +49,7 @@ public function testIsSaveable() '/v1/webhook_endpoints/' . self::TEST_RESOURCE_ID ); $resource->save(); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resource); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resource); } public function testIsUpdatable() @@ -61,7 +61,7 @@ public function testIsUpdatable() $resource = WebhookEndpoint::update(self::TEST_RESOURCE_ID, [ 'enabled_events' => ['charge.succeeded'], ]); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resource); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resource); } public function testIsDeletable() @@ -72,6 +72,6 @@ public function testIsDeletable() '/v1/webhook_endpoints/' . self::TEST_RESOURCE_ID ); $resource->delete(); - $this->assertInstanceOf("Stripe\\WebhookEndpoint", $resource); + $this->assertInstanceOf(\Stripe\WebhookEndpoint::class, $resource); } }