bigcommerce-api-php icon indicating copy to clipboard operation
bigcommerce-api-php copied to clipboard

Implement connection interface for mocking data

Open furang opened this issue 3 years ago • 0 comments

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 avatar Dec 06 '21 11:12 furang