2020-09-25 18:06:41 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 7.4
|
|
|
|
*
|
|
|
|
* @category EnvironmentTest
|
|
|
|
* @package Component
|
|
|
|
* @author RetailCRM <integration@retailcrm.ru>
|
|
|
|
* @license MIT
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see http://help.retailcrm.ru
|
|
|
|
*/
|
|
|
|
namespace Component;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2020-09-28 13:27:19 +03:00
|
|
|
use RetailCrm\Component\Environment;
|
|
|
|
use RetailCrm\Factory\ClientFactory;
|
|
|
|
use RetailCrm\Factory\ContainerFactory;
|
2020-09-25 18:06:41 +03:00
|
|
|
use RetailCrm\TopClient\Client;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class EnvironmentTest
|
|
|
|
*
|
|
|
|
* @category EnvironmentTest
|
|
|
|
* @package Component
|
|
|
|
* @author RetailDriver LLC <integration@retailcrm.ru>
|
|
|
|
* @license MIT
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see https://help.retailcrm.ru
|
|
|
|
*/
|
|
|
|
class EnvironmentTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testCreateClient()
|
|
|
|
{
|
2020-09-28 13:27:19 +03:00
|
|
|
$client = ClientFactory::withContainer(
|
|
|
|
ContainerFactory::withEnv(Environment::DEV)
|
|
|
|
->withClient(new \GuzzleHttp\Client())
|
|
|
|
->create()
|
|
|
|
)->setServiceUrl(Client::OVERSEAS_ENDPOINT)->create();
|
2020-09-25 18:06:41 +03:00
|
|
|
|
|
|
|
self::assertInstanceOf(Client::class, $client);
|
|
|
|
}
|
|
|
|
}
|