X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FUpdateActionsWithEntityPluginsTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FUpdateActionsWithEntityPluginsTest.php;h=764c92c5ffb54100fa831e0508b6da1dcc3a6377;hp=4094d00313d8e8b7af69fa1371828d3a27bc79fc;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php b/web/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php index 4094d0031..764c92c5f 100644 --- a/web/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php +++ b/web/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php @@ -9,6 +9,7 @@ use Drupal\system\Entity\Action; * Tests upgrading comment and node actions to generic entity ones. * * @group Update + * @group legacy */ class UpdateActionsWithEntityPluginsTest extends UpdatePathTestBase { @@ -53,4 +54,33 @@ class UpdateActionsWithEntityPluginsTest extends UpdatePathTestBase { } } + /** + * Tests upgrading comment and node delete actions to generic entity ones. + * + * @see system_post_update_change_delete_action_plugins() + */ + public function testUpdateDeleteActionsWithEntityPlugins() { + // comment_delete_actions is not part of the dump files. + $array = [ + 'node_delete_action' => ['node_delete_action', 'entity:delete_action:node'], + ]; + + foreach ($array as $key => list($before, $after)) { + /** @var \Drupal\system\Entity\Action $action */ + $action = Action::load($key); + $this->assertSame($before, $action->getPlugin()->getPluginId()); + } + + $this->runUpdates(); + + foreach ($array as $key => list($before, $after)) { + /** @var \Drupal\system\Entity\Action $action */ + $action = Action::load($key); + $this->assertSame($after, $action->getPlugin()->getPluginId()); + + // Check that the type the action is based on will be a module dependency. + $this->assertArraySubset(['module' => [$action->getPluginDefinition()['type']]], $action->getDependencies()); + } + } + }