Skip to content

Commit ea92379

Browse files
committed
Add testCreatePurchaseWithMissingData test
1 parent 89f4b88 commit ea92379

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/ConvertKitAPITest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,24 @@ public function testCreatePurchase()
793793
$this->assertArrayHasKey('transaction_id', get_object_vars($purchase));
794794
}
795795

796+
/**
797+
* Test that create_purchase() throws a ClientException when an invalid
798+
* purchase data is specified.
799+
*
800+
* @since 1.0.0
801+
*
802+
* @return void
803+
*/
804+
public function testCreatePurchaseWithMissingData()
805+
{
806+
$this->expectException(GuzzleHttp\Exception\ClientException::class);
807+
$this->api->create_purchase([
808+
'invalid-key' => [
809+
'transaction_id' => str_shuffle('wfervdrtgsdewrafvwefds'),
810+
],
811+
]);
812+
}
813+
796814
/**
797815
* Test that fetching a legacy form's markup works.
798816
*

0 commit comments

Comments
 (0)