-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
We're currently integrating the ConvertAPI into our project. When writing a unit test, we tried to mock the ConvertApi class. This works fine to a certain extend. In a piece of code we have the following:
ConvertApi::$apiBase = 'eu-v2.convertapi.com';
We use PhpUnit and Mockery to write tests, and currently mocking static properties is not supported. After some experimenting, we found the best solution would be to add a setter (like setApiSecret) so that we can finish our unit test. I think other people can also benefit from this, as it's not possible to write a unit test if you set a custom apiBase.
Thoughts about this? I can open a PR if there's interest in this.
PR here: #28
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels