Skip to content
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

Implement connection interface for mocking data #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

furang
Copy link

@furang furang commented Dec 6, 2021

What?

This request implement ConnectionInterface. I think this is very useful so now you can create custom connection service and mock necessary responses without even having developer account.
You just have to create a Client instance and set custom Connection service with setConnection

use Bigcommerce\Api\Client as Bigcommerce;

...

$customConnection = new ConnectionMock();

...

Bigcommerce::configure($creds);
Bigcommerce::setConnection($customConnection);

After that you can use any bundle methods and receive responses mocked in custom ConnectionMock class.

@furang furang changed the title Patch connection interface Implement connection interface for mocking data Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant