2018-12-05 17:10:00 +03:00
|
|
|
<?php
|
|
|
|
|
2020-02-19 21:50:16 +03:00
|
|
|
require_once __DIR__ . '/../' . getenv('TEST_SUITE') . '/TestCase.php';
|
2020-02-19 12:37:03 +03:00
|
|
|
|
|
|
|
class ModelRetailcrmEventAdminTest extends TestCase
|
2018-12-05 17:10:00 +03:00
|
|
|
{
|
|
|
|
const CODE = 'test';
|
|
|
|
|
2020-02-19 12:45:02 +03:00
|
|
|
public function setUp()
|
2018-12-05 17:10:00 +03:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
2020-02-20 15:26:18 +03:00
|
|
|
if (getenv('TEST_SUITE') === '3.0') {
|
|
|
|
$eventModel = $this->loadModel('setting/event');
|
|
|
|
} else {
|
|
|
|
$eventModel = $this->loadModel('extension/event');
|
|
|
|
}
|
|
|
|
|
2018-12-05 17:10:00 +03:00
|
|
|
$eventModel->addEvent(self::CODE, 'test', 'test');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetEvent()
|
|
|
|
{
|
|
|
|
$eventModel = $this->loadModel('extension/retailcrm/event');
|
|
|
|
$event = $eventModel->getEventByCode(self::CODE);
|
|
|
|
|
|
|
|
$this->assertNotEmpty($event);
|
|
|
|
$this->assertEquals(self::CODE, $event['code']);
|
|
|
|
$this->assertEquals('test', $event['trigger']);
|
|
|
|
$this->assertEquals('test', $event['action']);
|
|
|
|
}
|
|
|
|
}
|