You are here

public function DeleteActionTest::testGetDerivativeDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php \Drupal\KernelTests\Core\Action\DeleteActionTest::testGetDerivativeDefinitions()
  2. 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 43

Class

DeleteActionTest
@group Action

Namespace

Drupal\KernelTests\Core\Action

Code

public function testGetDerivativeDefinitions() {
  $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',
  ]));
}