Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / views / tests / src / Functional / Update / BulkFormUpdateTest.php
diff --git a/web/core/modules/views/tests/src/Functional/Update/BulkFormUpdateTest.php b/web/core/modules/views/tests/src/Functional/Update/BulkFormUpdateTest.php
new file mode 100644 (file)
index 0000000..5db54d2
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\Tests\views\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+use Drupal\views\Entity\View;
+
+/**
+ * Tests Views image style dependencies update.
+ *
+ * @group views
+ */
+class BulkFormUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+      __DIR__ . '/../../../fixtures/update/legacy-bulk-form-update.php'
+    ];
+  }
+
+  /**
+   * Tests the updating of dependencies for Views using the bulk_form plugin.
+   */
+  public function testBulkFormDependencies() {
+    $module_dependencies = View::load('legacy_bulk_form')->getDependencies()['module'];
+
+    $this->assertTrue(in_array('system', $module_dependencies));
+
+    $this->runUpdates();
+
+    $module_dependencies = View::load('legacy_bulk_form')->getDependencies()['module'];
+
+    $this->assertFalse(in_array('system', $module_dependencies));
+  }
+
+}