LogCategoryTest.php in Commerce Core 8.2
File
modules/log/tests/src/Unit/LogCategoryTest.php
View source
<?php
namespace Drupal\Tests\commerce_log\Unit;
use Drupal\commerce_log\Plugin\LogCategory\LogCategory;
use Drupal\Tests\UnitTestCase;
class LogCategoryTest extends UnitTestCase {
protected $logCategory;
protected $definition = [
'id' => 'entity_test',
'label' => 'Entity Test',
'entity_type' => 'entity_test',
'provider' => 'commerce_log_test',
];
protected function setUp() : void {
parent::setUp();
$this->logCategory = new LogCategory([], 'order', $this->definition);
}
public function testGetId() {
$this
->assertEquals($this->definition['id'], $this->logCategory
->getId());
}
public function testGetLabel() {
$this
->assertEquals($this->definition['label'], $this->logCategory
->getLabel());
}
public function testGetEntityTypeId() {
$this
->assertEquals($this->definition['entity_type'], $this->logCategory
->getEntityTypeId());
}
}