WorkflowGroupTest.php in State Machine 8
File
tests/src/Unit/Plugin/WorkflowGroup/WorkflowGroupTest.php
View source
<?php
namespace Drupal\Tests\state_machine\Unit\Plugin\WorkflowGroup;
use Drupal\state_machine\Plugin\Workflow\Workflow;
use Drupal\state_machine\Plugin\WorkflowGroup\WorkflowGroup;
use Drupal\Tests\UnitTestCase;
class WorkflowGroupTest extends UnitTestCase {
protected $workflowGroup;
protected $definition = [
'id' => 'entity_test',
'label' => 'Entity Test',
'entity_type' => 'entity_test',
'class' => WorkflowGroup::class,
'workflow_class' => Workflow::class,
'provider' => 'state_machine_test',
];
protected function setUp() {
parent::setUp();
$this->workflowGroup = new WorkflowGroup([], 'order', $this->definition);
}
public function testGetId() {
$this
->assertEquals($this->definition['id'], $this->workflowGroup
->getId());
}
public function testGetLabel() {
$this
->assertEquals($this->definition['label'], $this->workflowGroup
->getLabel(), 'Workflow group label matches the expected one');
}
public function testGetEntityTypeId() {
$this
->assertEquals($this->definition['entity_type'], $this->workflowGroup
->getEntityTypeId(), 'Workflow group entity type id matches the expected one');
}
public function testGetWorkflowClass() {
$this
->assertEquals($this->definition['workflow_class'], $this->workflowGroup
->getWorkflowClass(), 'Workflow group class matches the expected one');
}
}