LogTemplateTest.php in Commerce Core 8.2
File
modules/log/tests/src/Unit/LogTemplateTest.php
View source
<?php
namespace Drupal\Tests\commerce_log\Unit;
use Drupal\commerce_log\Plugin\LogTemplate\LogTemplate;
use Drupal\Tests\UnitTestCase;
class LogTemplateTest extends UnitTestCase {
protected $logTemplate;
protected $definition = [
'id' => 'entity_test',
'label' => 'Entity Test Template',
'category' => 'entity_test_group',
'template' => '<p>Hello {{ message }}</p>',
];
protected function setUp() : void {
parent::setUp();
$this->logTemplate = new LogTemplate([], 'order', $this->definition);
}
public function testGetId() {
$this
->assertEquals($this->definition['id'], $this->logTemplate
->getId());
}
public function testGetLabel() {
$this
->assertEquals($this->definition['label'], $this->logTemplate
->getLabel());
}
public function getCategory() {
$this
->assertEquals($this->definition['category'], $this->logTemplate
->getCategory());
}
public function getTemplate() {
$this
->assertEquals($this->definition['template'], $this->logTemplate
->getTemplate());
}
}