function RequiredStatesTest::testGetRequiredStates
Same name in other branches
- 9 core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testGetRequiredStates()
- 10 core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testGetRequiredStates()
- 11.x core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testGetRequiredStates()
@covers ::getRequiredStates @covers ::__construct
File
-
core/
modules/ workflows/ tests/ src/ Kernel/ RequiredStatesTest.php, line 27
Class
- RequiredStatesTest
- Tests Workflow type's required states and configuration initialization.
Namespace
Drupal\Tests\workflows\KernelCode
public function testGetRequiredStates() {
$workflow = new Workflow([
'id' => 'test',
'type' => 'workflow_type_required_state_test',
], 'workflow');
$workflow->save();
$this->assertEquals([
'fresh',
'rotten',
], $workflow->getTypePlugin()
->getRequiredStates());
// Ensure that the workflow has the default configuration.
$this->assertTrue($workflow->getTypePlugin()
->hasState('rotten'));
$this->assertTrue($workflow->getTypePlugin()
->hasState('fresh'));
$this->assertTrue($workflow->getTypePlugin()
->hasTransitionFromStateToState('fresh', 'rotten'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.