Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
#44 — Test throw exception in case of null action
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefersson Nathan committed Apr 25, 2017
1 parent 7e0d58c commit 26916ac
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/src/PHPRouterTest/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,20 @@ public function testShouldGetInstanceFromContainerIfContainerIsProvided()

$this->routeWithParameters->dispatch();
}

public function testShouldRaiseAnExceptionIfActionIsNull()
{
$route = new Route(
'/page/:page_id',
array(
'_controller' => 'PHPRouter\Test\SomeController::',
'methods' => array('GET'),
'target' => 'thisIsAString',
'name' => 'page'
)
);

$this->setExpectedException('\RuntimeException');
$route->dispatch();
}
}

0 comments on commit 26916ac

Please sign in to comment.