Unit test update
This commit is contained in:
parent
ef12474dfc
commit
5ecedd12f0
@ -6,12 +6,17 @@ class IntegrationModuleTest extends \PHPUnit\Framework\TestCase
|
|||||||
{
|
{
|
||||||
private $mockResourceConfig;
|
private $mockResourceConfig;
|
||||||
private $mockApiClient;
|
private $mockApiClient;
|
||||||
|
private $mockData;
|
||||||
private $unit;
|
private $unit;
|
||||||
|
|
||||||
const ACCOUNT_URL = 'test';
|
const ACCOUNT_URL = 'test';
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
|
$this->mockData = $this->getMockBuilder(\Retailcrm\Retailcrm\Helper\Data::class)
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$this->mockResourceConfig = $this->getMockBuilder(\Magento\Config\Model\ResourceModel\Config::class)
|
$this->mockResourceConfig = $this->getMockBuilder(\Magento\Config\Model\ResourceModel\Config::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
@ -24,7 +29,10 @@ class IntegrationModuleTest extends \PHPUnit\Framework\TestCase
|
|||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$this->unit = new \Retailcrm\Retailcrm\Model\Service\IntegrationModule($this->mockResourceConfig);
|
$this->unit = new \Retailcrm\Retailcrm\Model\Service\IntegrationModule(
|
||||||
|
$this->mockResourceConfig,
|
||||||
|
$this->mockData
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,8 +74,8 @@ class IntegrationModuleTest extends \PHPUnit\Framework\TestCase
|
|||||||
$configuration['logo']
|
$configuration['logo']
|
||||||
);
|
);
|
||||||
$this->assertArrayHasKey('code', $configuration);
|
$this->assertArrayHasKey('code', $configuration);
|
||||||
$this->assertEquals(
|
$this->assertContains(
|
||||||
\Retailcrm\Retailcrm\Model\Service\IntegrationModule::CODE,
|
\Retailcrm\Retailcrm\Model\Service\IntegrationModule::INTEGRATION_CODE,
|
||||||
$configuration['code']
|
$configuration['code']
|
||||||
);
|
);
|
||||||
$this->assertArrayHasKey('active', $configuration);
|
$this->assertArrayHasKey('active', $configuration);
|
||||||
@ -80,8 +88,8 @@ class IntegrationModuleTest extends \PHPUnit\Framework\TestCase
|
|||||||
$this->assertArrayHasKey('accountUrl', $configuration);
|
$this->assertArrayHasKey('accountUrl', $configuration);
|
||||||
$this->assertEquals(self::ACCOUNT_URL, $configuration['accountUrl']);
|
$this->assertEquals(self::ACCOUNT_URL, $configuration['accountUrl']);
|
||||||
$this->assertArrayHasKey('integrationCode', $configuration);
|
$this->assertArrayHasKey('integrationCode', $configuration);
|
||||||
$this->assertEquals(
|
$this->assertContains(
|
||||||
\Retailcrm\Retailcrm\Model\Service\IntegrationModule::CODE,
|
\Retailcrm\Retailcrm\Model\Service\IntegrationModule::INTEGRATION_CODE,
|
||||||
$configuration['integrationCode']
|
$configuration['integrationCode']
|
||||||
);
|
);
|
||||||
$this->assertArrayHasKey('clientId', $configuration);
|
$this->assertArrayHasKey('clientId', $configuration);
|
||||||
|
Loading…
Reference in New Issue
Block a user