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

Commit 9a3b951

Browse files
author
Jefersson Nathan
committed
#44 — Test throw exception in case of null action
1 parent fea9a8d commit 9a3b951

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/src/PHPRouterTest/RouteTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,20 @@ public function testShouldGetInstanceFromContainerIfContainerIsProvided()
117117

118118
$this->routeWithParameters->dispatch();
119119
}
120+
121+
public function testShouldRaiseAnExceptionIfActionIsNull()
122+
{
123+
$route = new Route(
124+
'/page/:page_id',
125+
array(
126+
'_controller' => 'PHPRouter\Test\SomeController::',
127+
'methods' => array('GET'),
128+
'target' => 'thisIsAString',
129+
'name' => 'page'
130+
)
131+
);
132+
133+
$this->setExpectedException('\RuntimeException');
134+
$route->dispatch();
135+
}
120136
}

0 commit comments

Comments
 (0)