Skip to content

Commit

Permalink
test: fix some test case errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ping-yee committed Sep 22, 2023
1 parent a1f2c50 commit f3aadcc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/system/Router/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,16 @@ public function testAutoRouteFindsControllerWithSubfolder(): void

rmdir(APPPATH . 'Controllers/Subfolder');

$this->expectException(PageNotFoundException::class);

$this->assertSame('MyController', $router->controllerName());
$this->assertSame('someMethod', $router->methodName());
}

public function testAutoRouteFindsDashedSubfolder(): void
{
$this->collection->setAutoRoute(true);

$router = new Router($this->collection, $this->request);
$router->setTranslateURIDashes(true);

Expand All @@ -266,6 +269,8 @@ public function testAutoRouteFindsDashedSubfolder(): void

rmdir(APPPATH . 'Controllers/Dash_folder');

$this->expectException(PageNotFoundException::class);

$this->assertSame('Dash_folder/', $router->directory());
$this->assertSame('Mycontroller', $router->controllerName());
$this->assertSame('somemethod', $router->methodName());
Expand Down Expand Up @@ -329,6 +334,7 @@ public function testAutoRouteFindsDefaultDashFolder(): void
public function testAutoRouteFindsMByteDir(): void
{
$this->collection->setAutoRoute(true);

$router = new Router($this->collection, $this->request);
$router->setTranslateURIDashes(true);

Expand All @@ -338,6 +344,8 @@ public function testAutoRouteFindsMByteDir(): void

rmdir(APPPATH . 'Controllers/Φ');

$this->expectException(PageNotFoundException::class);

$this->assertSame('Φ/', $router->directory());
$this->assertSame('Home', $router->controllerName());
$this->assertSame('index', $router->methodName());
Expand Down

0 comments on commit f3aadcc

Please sign in to comment.