f4672b4cd117856c92fcf791eaf32e5125853697
[yaffs-website] / web / core / modules / system / tests / src / Functional / Update / RouterIndexOptimizationTest.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6
7 /**
8  * Tests system_update_8002().
9  *
10  * @group Update
11  * @group legacy
12  */
13 class RouterIndexOptimizationTest extends UpdatePathTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected function setDatabaseDumpFiles() {
19     $this->databaseDumpFiles = [
20       __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
21     ];
22   }
23
24   /**
25    * Ensures that the system_update_8002() runs as expected.
26    */
27   public function testUpdate() {
28     $this->runUpdates();
29     $database = $this->container->get('database');
30     // Removed index.
31     $this->assertFalse($database->schema()->indexExists(
32       'router', 'pattern_outline_fit'
33     ));
34     // Added index.
35     $this->assertTrue($database->schema()->indexExists(
36       'router', 'pattern_outline_parts'
37     ));
38   }
39
40 }