X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fentity%2Ftests%2Fsrc%2FKernel%2FDeleteActionTest.php;fp=web%2Fmodules%2Fcontrib%2Fentity%2Ftests%2Fsrc%2FKernel%2FDeleteActionTest.php;h=0000000000000000000000000000000000000000;hp=68680f09dc1fe9a138072bd902f68fad8a4bd636;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/entity/tests/src/Kernel/DeleteActionTest.php b/web/modules/contrib/entity/tests/src/Kernel/DeleteActionTest.php deleted file mode 100644 index 68680f09d..000000000 --- a/web/modules/contrib/entity/tests/src/Kernel/DeleteActionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('entity_test_enhanced'); - $this->installSchema('system', ['key_value_expire', 'sequences']); - - $bundle = EnhancedEntityBundle::create([ - 'id' => 'default', - 'label' => 'Default', - ]); - $bundle->save(); - - $this->user = User::create([ - 'name' => 'username', - 'status' => 1, - ]); - $this->user->save(); - \Drupal::service('current_user')->setAccount($this->user); - } - - public function testAction() { - /** @var \Drupal\system\ActionConfigEntityInterface $action */ - $action = Action::create([ - 'id' => 'enhanced_entity_delete_action', - 'label' => 'Delete enhanced entity', - 'plugin' => 'entity_delete_action:entity_test_enhanced', - ]); - $status = $action->save(); - $this->assertEquals(SAVED_NEW, $status); - $this->assertInstanceOf(DeleteAction::class, $action->getPlugin()); - - $entities = []; - for ($i = 0; $i < 2; $i++) { - $entity = EnhancedEntity::create([ - 'type' => 'default', - ]); - $entity->save(); - $entities[$entity->id()] = $entity; - } - - $action->execute($entities); - // Confirm that the entity ids and langcodes are now in the tempstore. - $tempstore = \Drupal::service('tempstore.private')->get('entity_delete_multiple_confirm'); - $selection = $tempstore->get($this->user->id() . ':entity_test_enhanced'); - $this->assertEquals(array_keys($entities), array_keys($selection)); - $this->assertEquals([['en' => 'en'], ['en' => 'en']], array_values($selection)); - } - -}