public function StateTest::testGetTransitionTo in Drupal 10
Same name and namespace in other branches
- 8 core/modules/workflows/tests/src/Unit/StateTest.php \Drupal\Tests\workflows\Unit\StateTest::testGetTransitionTo()
- 9 core/modules/workflows/tests/src/Unit/StateTest.php \Drupal\Tests\workflows\Unit\StateTest::testGetTransitionTo()
@covers ::getTransitionTo
File
- core/
modules/ workflows/ tests/ src/ Unit/ StateTest.php, line 55
Class
- StateTest
- @coversDefaultClass \Drupal\workflows\State
Namespace
Drupal\Tests\workflows\UnitCode
public function testGetTransitionTo() {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
->addState('published', 'Published')
->addTransition('publish', 'Publish', [
'draft',
], 'published');
$state = $workflow_type
->getState('draft');
$transition = $state
->getTransitionTo('published');
$this
->assertEquals('Publish', $transition
->label());
}