function StateTest::testLabelCallback

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

@covers ::labelCallback

File

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

Class

StateTest
@coversDefaultClass \Drupal\workflows\State

Namespace

Drupal\Tests\workflows\Unit

Code

public function testLabelCallback() : void {
    $workflow_type = $this->prophesize(WorkflowTypeInterface::class)
        ->reveal();
    $states = [
        new State($workflow_type, 'draft', 'Draft'),
        new State($workflow_type, 'published', 'Published'),
    ];
    $this->assertEquals([
        'Draft',
        'Published',
    ], array_map([
        State::class,
        'labelCallback',
    ], $states));
}

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