function PublishActionTest::testGetDerivativeDefinitions

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php \Drupal\KernelTests\Core\Action\PublishActionTest::testGetDerivativeDefinitions()
  2. 10 core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php \Drupal\KernelTests\Core\Action\PublishActionTest::testGetDerivativeDefinitions()
  3. 11.x core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php \Drupal\KernelTests\Core\Action\PublishActionTest::testGetDerivativeDefinitions()

@covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityPublishedActionDeriver::getDerivativeDefinitions

File

core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php, line 31

Class

PublishActionTest
@group Action

Namespace

Drupal\KernelTests\Core\Action

Code

public function testGetDerivativeDefinitions() {
    $deriver = new EntityPublishedActionDeriver(\Drupal::entityTypeManager(), \Drupal::translation());
    $definitions = $deriver->getDerivativeDefinitions([
        'action_label' => 'Save',
    ]);
    $this->assertEquals([
        'type' => 'entity_test_mulrevpub',
        'label' => 'Save test entity - revisions, data table, and published interface',
        'action_label' => 'Save',
    ], $definitions['entity_test_mulrevpub']);
}

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