function TransitionTest::testGetters

Same name and namespace in other branches
  1. 11.x core/modules/workflows/tests/src/Unit/TransitionTest.php \Drupal\Tests\workflows\Unit\TransitionTest::testGetters()
  2. 10 core/modules/workflows/tests/src/Unit/TransitionTest.php \Drupal\Tests\workflows\Unit\TransitionTest::testGetters()
  3. 9 core/modules/workflows/tests/src/Unit/TransitionTest.php \Drupal\Tests\workflows\Unit\TransitionTest::testGetters()
  4. 8.9.x core/modules/workflows/tests/src/Unit/TransitionTest.php \Drupal\Tests\workflows\Unit\TransitionTest::testGetters()

Tests getters.

@legacy-covers ::__construct @legacy-covers ::id @legacy-covers ::label

File

core/modules/workflows/tests/src/Unit/TransitionTest.php, line 28

Class

TransitionTest
Tests Drupal\workflows\Transition.

Namespace

Drupal\Tests\workflows\Unit

Code

public function testGetters() : void {
  $state = new Transition($this->prophesize(WorkflowTypeInterface::class)
    ->reveal(), 'draft_published', 'Publish', [
    'draft',
  ], 'published');
  $this->assertEquals('draft_published', $state->id());
  $this->assertEquals('Publish', $state->label());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.