function DeleteActionTest::testGetDerivativeDefinitions

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

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

File

core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php, line 44

Class

DeleteActionTest
@group Action

Namespace

Drupal\KernelTests\Core\Action

Code

public function testGetDerivativeDefinitions() : void {
    $deriver = new EntityDeleteActionDeriver(\Drupal::entityTypeManager(), \Drupal::translation());
    $this->assertEquals([
        'entity_test_mulrevpub' => [
            'type' => 'entity_test_mulrevpub',
            'label' => 'Delete test entity - revisions, data table, and published interface',
            'action_label' => 'Delete',
            'confirm_form_route_name' => 'entity.entity_test_mulrevpub.delete_multiple_form',
        ],
        'entity_test_revpub' => [
            'type' => 'entity_test_revpub',
            'label' => 'Delete test entity - revisions and publishing status',
            'action_label' => 'Delete',
            'confirm_form_route_name' => 'entity.entity_test_revpub.delete_multiple_form',
        ],
        'entity_test_rev' => [
            'type' => 'entity_test_rev',
            'label' => 'Delete test entity - revisions',
            'action_label' => 'Delete',
            'confirm_form_route_name' => 'entity.entity_test_rev.delete_multiple_form',
        ],
    ], $deriver->getDerivativeDefinitions([
        'action_label' => 'Delete',
    ]));
}

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