1
0
mirror of synced 2024-11-23 21:26:01 +03:00
aliexpress-top-client/tests/RetailCrm/Tests/Component/ClientFactoryTest.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2020-09-25 18:06:41 +03:00
<?php
/**
* PHP version 7.4
*
2020-09-28 16:08:55 +03:00
* @category ClientFactoryTest
* @package RetailCrm\Tests\Component
2020-09-25 18:06:41 +03:00
* @author RetailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://help.retailcrm.ru
*/
namespace RetailCrm\Tests\Component;
2020-09-25 18:06:41 +03:00
use RetailCrm\Component\AppData;
2020-09-28 16:08:55 +03:00
use RetailCrm\Component\Authenticator\TokenAuthenticator;
use RetailCrm\Component\ServiceLocator;
2020-09-28 13:27:19 +03:00
use RetailCrm\Factory\ClientFactory;
use RetailCrm\Test\TestCase;
2020-09-25 18:06:41 +03:00
use RetailCrm\TopClient\Client;
/**
2020-09-28 16:08:55 +03:00
* Class ClientFactoryTest
2020-09-25 18:06:41 +03:00
*
2020-09-28 16:08:55 +03:00
* @category ClientFactoryTest
* @package RetailCrm\Tests\Component
2020-09-25 18:06:41 +03:00
* @author RetailDriver LLC <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see https://help.retailcrm.ru
*/
2020-09-28 16:08:55 +03:00
class ClientFactoryTest extends TestCase
2020-09-25 18:06:41 +03:00
{
public function testCreateClient()
{
$client = ClientFactory::withContainer($this->getContainer())
->setAppData(AppData::create(AppData::OVERSEAS_ENDPOINT, 'appKey', 'helloworld'))
2020-09-28 16:08:55 +03:00
->setAuthenticator(new TokenAuthenticator('appKey', 'token'))
->create();
2020-09-25 18:06:41 +03:00
self::assertInstanceOf(Client::class, $client);
self::assertInstanceOf(ServiceLocator::class, $client->getServiceLocator());
2020-09-25 18:06:41 +03:00
}
}