diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 066a0d33f..36880705e 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -1005,7 +1005,8 @@ public function testSearchCharge() $result = $this->client->charges->search( ['query' => 'amount>999 AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Charge","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); } public function testListSession() @@ -1337,7 +1338,8 @@ public function testSearchCustomer() $result = $this->client->customers->search( ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Customer","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); } public function testSearchCustomer2() @@ -1346,7 +1348,8 @@ public function testSearchCustomer2() $result = $this->client->customers->search( ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Customer","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); } public function testListDispute() @@ -1732,7 +1735,8 @@ public function testSearchInvoice() $result = $this->client->invoices->search( ['query' => 'total>999 AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Invoice","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); } public function testListAuthorization() @@ -2065,7 +2069,8 @@ public function testSearchPaymentIntent() $result = $this->client->paymentIntents->search( ['query' => 'status:\'succeeded\' AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"PaymentIntent","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); } public function testListPaymentLink() @@ -2308,7 +2313,8 @@ public function testSearchPrice() $result = $this->client->prices->search( ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Price","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); } public function testListProduct() @@ -2356,7 +2362,8 @@ public function testSearchProduct() $result = $this->client->products->search( ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Product","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); } public function testListPromotionCode() @@ -3074,7 +3081,8 @@ public function testSearchSubscription() $result = $this->client->subscriptions->search( ['query' => 'status:\'active\' AND metadata[\'order_id\']:\'6735\''] ); - // TODO: assert proper instance, {"shape":"searchResultObject","type":{"shape":"ref","ref":"Subscription","namespaces":[]},"hasSearchResultType":true} + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); } public function testListTaxCode()