Skip to content

Commit

Permalink
MNT Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 23, 2024
1 parent 715c2de commit aa9988d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/php/ORM/DBReplicaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit aa9988d

Please sign in to comment.