2019-02-28 14:45:39 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RetailCrmCollectorTest extends \PHPUnit\Framework\TestCase
|
|
|
|
{
|
|
|
|
const TEST_KEY = 'RC-XXXXXXXXXX-X';
|
|
|
|
|
2023-03-15 11:55:04 +03:00
|
|
|
public function setUp(): void
|
2019-02-28 14:45:39 +03:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
COption::SetOptionString(
|
|
|
|
RetailCrmCollector::$MODULE_ID,
|
|
|
|
RetailCrmCollector::$CRM_COLL_KEY,
|
|
|
|
serialize([SITE_ID => self::TEST_KEY])
|
|
|
|
);
|
|
|
|
|
|
|
|
COption::SetOptionString(
|
|
|
|
RetailCrmCollector::$MODULE_ID,
|
|
|
|
RetailCrmCollector::$CRM_COLL,
|
|
|
|
'Y'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAdd()
|
|
|
|
{
|
|
|
|
RetailCrmCollector::add();
|
|
|
|
$strings = \Bitrix\Main\Page\Asset::getInstance()->getStrings();
|
|
|
|
|
2023-03-15 11:55:04 +03:00
|
|
|
$this->assertStringContainsString(self::TEST_KEY, $strings);
|
|
|
|
$this->assertStringContainsString('customerId', $strings);
|
2019-02-28 14:45:39 +03:00
|
|
|
}
|
|
|
|
}
|