opencart-module/tests/admin/ModelRetailcrmEventAdminTest.php

28 lines
727 B
PHP
Raw Permalink Normal View History

<?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
{
const CODE = 'test';
2020-02-19 12:45:02 +03:00
public function setUp()
{
parent::setUp();
2021-09-02 11:19:20 +03:00
$eventModel = $this->loadModel('setting/event');
$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']);
}
}