Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / Update / RouterIndexOptimizationTest.php
diff --git a/web/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationTest.php b/web/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationTest.php
new file mode 100644 (file)
index 0000000..a3bfad2
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+namespace Drupal\Tests\system\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+
+/**
+ * Tests system_update_8002().
+ *
+ * @group Update
+ */
+class RouterIndexOptimizationTest extends UpdatePathTestBase {
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Ensures that the system_update_8002() runs as expected.
+   */
+  public function testUpdate() {
+    $this->runUpdates();
+    $database = $this->container->get('database');
+    // Removed index.
+    $this->assertFalse($database->schema()->indexExists(
+      'router', 'pattern_outline_fit'
+    ));
+    // Added index.
+    $this->assertTrue($database->schema()->indexExists(
+      'router', 'pattern_outline_parts'
+    ));
+  }
+
+}