function StateTest::testGetters

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

@covers ::__construct @covers ::id @covers ::label @covers ::weight

File

core/modules/workflows/tests/src/Unit/StateTest.php, line 25

Class

StateTest
@coversDefaultClass \Drupal\workflows\State

Namespace

Drupal\Tests\workflows\Unit

Code

public function testGetters() : void {
    $state = new State($this->prophesize(WorkflowTypeInterface::class)
        ->reveal(), 'draft', 'Draft', 3);
    $this->assertEquals('draft', $state->id());
    $this->assertEquals('Draft', $state->label());
    $this->assertEquals(3, $state->weight());
}

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