From aa9988d4349ef6f3c4634a294d23f5a3994dc419 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 23 Oct 2024 15:05:56 +1300 Subject: [PATCH] MNT Fix unit test --- tests/php/ORM/DBReplicaTest.php | 2 ++ 1 file changed, 2 insertions(+) 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()); }