diff --git a/tests/php/ORM/DBReplicaTest.php b/tests/php/ORM/DBReplicaTest.php index d601e8b6540..85ef95bff15 100644 --- a/tests/php/ORM/DBReplicaTest.php +++ b/tests/php/ORM/DBReplicaTest.php @@ -180,10 +180,12 @@ public function testRoutes(string $path, string $expected): void { // Create a custom rule to test our controller that should default to using a replica $rules = Config::inst()->get(Director::class, 'rules'); + $rules['test/dev'] = TestController::class; $rules['test'] = TestController::class; // Ensure that routes staring with '$' are at the bottom of the assoc array index and don't override // our new 'test' route uksort($rules, fn($a, $b) => str_starts_with($a, '$') ? 1 : (str_starts_with($b, '$') ? -1 : 0)); + Config::modify()->set(Director::class, 'rules', $rules); $this->get($path); $this->assertSame($expected, $this->getLastConnectionName()); }