add factory test
This commit is contained in:
parent
ae34da0214
commit
58d9c0f1a7
1 changed files with 22 additions and 0 deletions
22
tests/lib/component/factory/ClientFactoryTest.php
Normal file
22
tests/lib/component/factory/ClientFactoryTest.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Intaro\RetailCrm\Component\Factory;
|
||||
|
||||
use Bitrix\Main\Config\Option;
|
||||
use Intaro\RetailCrm\Component\ApiClient\ClientAdapter;
|
||||
use Intaro\RetailCrm\Component\ConfigProvider;
|
||||
use Intaro\RetailCrm\Component\Factory\ClientFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ClientFactoryTest extends TestCase
|
||||
{
|
||||
public function testCreacteClientAdapter(): void
|
||||
{
|
||||
$client = ClientFactory::creacteClientAdapter();
|
||||
if (empty(ConfigProvider::getApiUrl())) {
|
||||
self::assertEquals(null, $client);
|
||||
}else{
|
||||
self::assertEquals(ClientAdapter::class, get_class($client));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue