function StateTest::testGetTransitionTo
@covers ::getTransitionTo
      
    
File
- 
              core/modules/ workflows/ tests/ src/ Unit/ StateTest.php, line 57 
Class
- StateTest
- @coversDefaultClass \Drupal\workflows\State[[api-linebreak]]
Namespace
Drupal\Tests\workflows\UnitCode
public function testGetTransitionTo() : void {
  $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());
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
