From ab15b22f43000f2968e7a4d3d41bd5c47c1dccab Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sun, 17 Feb 2019 10:12:55 +0000
Subject: [PATCH] Issue #3022399 by andypost, YurkinPark, Berdir: Move
 action_views_form_substitutions() out of actions module

---
 .../modules/action/action.views_execution.inc | 20 -------------------
 .../src/Functional/ActionUninstallTest.php    |  3 ++-
 .../action_bulk_test.info.yml                 |  1 -
 .../install/views.view.test_bulk_form.yml     |  0
 .../tests/src/Functional/BulkFormTest.php     |  6 +++---
 core/modules/views/views.views_execution.inc  | 14 +++++++++++++
 ...solvedLibraryDefinitionsFilesMatchTest.php |  3 ++-
 .../Core/Theme/StableLibraryOverrideTest.php  |  3 ++-
 8 files changed, 23 insertions(+), 27 deletions(-)
 delete mode 100644 core/modules/action/action.views_execution.inc
 rename core/modules/{action/tests => views/tests/modules}/action_bulk_test/action_bulk_test.info.yml (91%)
 rename core/modules/{action/tests => views/tests/modules}/action_bulk_test/config/install/views.view.test_bulk_form.yml (100%)
 rename core/modules/{action => views}/tests/src/Functional/BulkFormTest.php (98%)

diff --git a/core/modules/action/action.views_execution.inc b/core/modules/action/action.views_execution.inc
deleted file mode 100644
index b9acfe9fc244..000000000000
--- a/core/modules/action/action.views_execution.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides views runtime hooks for action.module.
- */
-
-/**
- * Implements hook_views_form_substitutions().
- */
-function action_views_form_substitutions() {
-  $select_all = [
-    '#type' => 'checkbox',
-    '#default_value' => FALSE,
-    '#attributes' => ['class' => ['action-table-select-all']],
-  ];
-  return [
-    '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
-  ];
-}
diff --git a/core/modules/action/tests/src/Functional/ActionUninstallTest.php b/core/modules/action/tests/src/Functional/ActionUninstallTest.php
index 5b01099fd216..76170b166997 100644
--- a/core/modules/action/tests/src/Functional/ActionUninstallTest.php
+++ b/core/modules/action/tests/src/Functional/ActionUninstallTest.php
@@ -8,7 +8,8 @@
  * Tests that uninstalling actions does not remove other module's actions.
  *
  * @group action
- * @see \Drupal\action\Plugin\views\field\BulkForm
+ * @see \Drupal\views\Plugin\views\field\BulkForm
+ * @see \Drupal\user\Plugin\Action\BlockUser
  */
 class ActionUninstallTest extends BrowserTestBase {
 
diff --git a/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml b/core/modules/views/tests/modules/action_bulk_test/action_bulk_test.info.yml
similarity index 91%
rename from core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml
rename to core/modules/views/tests/modules/action_bulk_test/action_bulk_test.info.yml
index 810e72ca3470..e80c7504f0cb 100644
--- a/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml
+++ b/core/modules/views/tests/modules/action_bulk_test/action_bulk_test.info.yml
@@ -5,6 +5,5 @@ package: Testing
 version: VERSION
 core: 8.x
 dependencies:
-  - drupal:action
   - drupal:views
   - drupal:node
diff --git a/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml b/core/modules/views/tests/modules/action_bulk_test/config/install/views.view.test_bulk_form.yml
similarity index 100%
rename from core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml
rename to core/modules/views/tests/modules/action_bulk_test/config/install/views.view.test_bulk_form.yml
diff --git a/core/modules/action/tests/src/Functional/BulkFormTest.php b/core/modules/views/tests/src/Functional/BulkFormTest.php
similarity index 98%
rename from core/modules/action/tests/src/Functional/BulkFormTest.php
rename to core/modules/views/tests/src/Functional/BulkFormTest.php
index ec6ca482bca8..278a1ec7b9d5 100644
--- a/core/modules/action/tests/src/Functional/BulkFormTest.php
+++ b/core/modules/views/tests/src/Functional/BulkFormTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Tests\action\Functional;
+namespace Drupal\Tests\views\Functional;
 
 use Drupal\Tests\BrowserTestBase;
 use Drupal\views\Views;
@@ -8,8 +8,8 @@
 /**
  * Tests the views bulk form test.
  *
- * @group action
- * @see \Drupal\action\Plugin\views\field\BulkForm
+ * @group views
+ * @see \Drupal\views\Plugin\views\field\BulkForm
  */
 class BulkFormTest extends BrowserTestBase {
 
diff --git a/core/modules/views/views.views_execution.inc b/core/modules/views/views.views_execution.inc
index 8b324a359bf0..60b1adc04c65 100644
--- a/core/modules/views/views.views_execution.inc
+++ b/core/modules/views/views.views_execution.inc
@@ -25,3 +25,17 @@ function views_views_query_substitutions(ViewExecutable $view) {
 
   return $substitutions;
 }
+
+/**
+ * Implements hook_views_form_substitutions().
+ */
+function views_views_form_substitutions() {
+  $select_all = [
+    '#type' => 'checkbox',
+    '#default_value' => FALSE,
+    '#attributes' => ['class' => ['action-table-select-all']],
+  ];
+  return [
+    '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
+  ];
+}
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
index bbb3d6a5a02c..df57e1213e35 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
@@ -86,7 +86,7 @@ class ResolvedLibraryDefinitionsFilesMatchTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['system'];
+  public static $modules = ['system', 'user'];
 
   /**
    * {@inheritdoc}
@@ -114,6 +114,7 @@ protected function setUp() {
     unset($all_modules['demo_umami_content']);
     $this->allModules = array_keys($all_modules);
     $this->allModules[] = 'system';
+    $this->allModules[] = 'user';
     sort($this->allModules);
     $this->container->get('module_installer')->install($this->allModules);
 
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php
index 1976b2684c29..049438b25402 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php
@@ -49,7 +49,7 @@ class StableLibraryOverrideTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['system'];
+  public static $modules = ['system', 'user'];
 
   /**
    * {@inheritdoc}
@@ -71,6 +71,7 @@ protected function setUp() {
     });
     $this->allModules = array_keys($all_modules);
     $this->allModules[] = 'system';
+    $this->allModules[] = 'user';
     sort($this->allModules);
     $this->container->get('module_installer')->install($this->allModules);
 
-- 
GitLab