-
Notifications
You must be signed in to change notification settings - Fork 24
Add v4 API Key Support #105
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
Conversation
* | ||
* @return void | ||
*/ | ||
public function testAddSubscribersToForms() |
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.
What value do you see with these tests as they appear to be testing whether or not the Kit API is throwing an exception vs. testing logic in this library? Or am I misunderstanding?
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.
The bulk API endpoints and purchases endpoints don't support using an API Key, and therefore rightly return an error - so these tests confirm that the PHP SDK throws a ClientException, which I think there's value in doing here.
Summary
Resolves this reported issue, adding support for the named
apiKey
parameter on theConvertKit_API
class constructor.Testing
Shared tests have been moved to
tests/ConvertKitAPITest.php
, with bothConvertKitAPIKeyTest
andConvertKitAPIOAuth
tests inheriting them.These two test classes override some specific tests as required (e.g. bulk endpoints are not supported using an API Key, so tests exist in ConvertKitAPIKeyTest for these to ensure a
ClientException
is thrown).Checklist