-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix : add error handler for addProduct and addBillingPlan from subscription helper #623
Changes from all commits
8d566a3
45eba7c
f8c8a72
2b0ac9e
e51d9e8
83d333d
51f0ec3
c24b181
20d8187
3b2a88f
5098de1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,6 +255,52 @@ public function it_throws_exception_when_invalid_interval_is_provided_for_creati | |
$this->client = $this->client->addCustomPlan('Demo Plan', 'Demo Plan', 100, 'MONTHLY', 3); | ||
} | ||
|
||
/** @test */ | ||
public function it_throws_exception_when_get_error_for_creating_a_billing_plan() | ||
{ | ||
$this->client->setAccessToken([ | ||
'access_token' => self::$access_token, | ||
'token_type' => 'Bearer', | ||
]); | ||
|
||
$this->client->setClient( | ||
$this->mock_http_client( | ||
$this->mockCreateCatalogProductsResponse() | ||
) | ||
); | ||
|
||
$this->client = $this->client->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE'); | ||
|
||
$this->client->setClient( | ||
$this->mock_http_client( | ||
$this->mockCreatePlansErrorResponse() | ||
) | ||
); | ||
|
||
$this->expectException(\RuntimeException::class); | ||
|
||
$this->client = $this->client->addMonthlyPlan('Demo Plan', 'Demo Plan', 100); | ||
} | ||
|
||
/** @test */ | ||
public function it_throws_exception_when_get_error_for_creating_a_product() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Method name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srmklive should I rename it to camelCase format ? I see other code using snake_case |
||
{ | ||
$this->client->setAccessToken([ | ||
'access_token' => self::$access_token, | ||
'token_type' => 'Bearer', | ||
]); | ||
|
||
$this->client->setClient( | ||
$this->mock_http_client( | ||
$this->mockGetCatalogProductsErrorResponse() | ||
) | ||
); | ||
|
||
$this->expectException(\RuntimeException::class); | ||
|
||
$this->client = $this->client->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE'); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_create_a_subscription_without_trial() | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name
AdapterCreateSubscriptionHelpersTest::it_throws_exception_when_get_error_for_creating_a_billing_plan
is not in camel caps formatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srmklive should I rename it to camelCase format ? I see other code using snake_case