diff --git a/core/modules/system/src/Tests/Routing/RouteProviderTest.php b/core/modules/system/src/Tests/Routing/RouteProviderTest.php index ea67eff..c1d24ff 100644 --- a/core/modules/system/src/Tests/Routing/RouteProviderTest.php +++ b/core/modules/system/src/Tests/Routing/RouteProviderTest.php @@ -336,7 +336,7 @@ function testOutlinePathMatchDefaultsCollision2() { */ function testOutlinePathMatchDefaultsCollision3() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes'); $this->fixtures->createTables($connection); diff --git a/core/modules/system/src/Tests/Update/RouterIndexOptimizationTest.php b/core/modules/system/src/Tests/Update/RouterIndexOptimizationTest.php index 5759f10..b206011 100644 --- a/core/modules/system/src/Tests/Update/RouterIndexOptimizationTest.php +++ b/core/modules/system/src/Tests/Update/RouterIndexOptimizationTest.php @@ -27,12 +27,13 @@ public function setUp() { */ public function testUpdate() { $this->runUpdates(); + $database = $this->container->get('database'); // Removed index. - $this->assertFalse($this->getDatabaseConnection()->schema()->indexExists( + $this->assertFalse($database->schema()->indexExists( 'router', 'pattern_outline_fit' )); // Added index. - $this->assertTrue($this->getDatabaseConnection()->schema()->indexExists( + $this->assertTrue($database->schema()->indexExists( 'router', 'pattern_outline_parts' )); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index babd736..9c3466f 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1207,25 +1207,28 @@ function system_update_8001(&$sandbox = NULL) { * Change the index on the {router} table. */ function system_update_8002() { - Database::getConnection()->schema()->dropIndex('router', 'pattern_outline_fit'); - Database::getConnection()->schema()->addIndex( + $database = \Drupal::database(); + $database->schema()->dropIndex('router', 'pattern_outline_fit'); + $database->schema()->addIndex( 'router', 'pattern_outline_parts', ['pattern_outline', 'number_parts'], [ - 'pattern_outline' => [ - 'description' => 'The pattern', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ], - 'number_parts' => [ - 'description' => 'Number of parts in this router path.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'size' => 'small', + 'fields' => [ + 'pattern_outline' => [ + 'description' => 'The pattern', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ], + 'number_parts' => [ + 'description' => 'Number of parts in this router path.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ], ], ] );