Confirms that the HttpMethod matcher throws an exception for no-route.
public function testNoRouteFound() {
$matcher = new HttpMethodMatcher();
// Remove the sample route that would match any method.
$routes = $this->fixtures
->sampleRouteCollection();
$routes
->remove('route_d');
$matcher
->setCollection($routes);
try {
$routes = $matcher
->matchRequestPartial(Request::create('path/one', 'DELETE'));
$this
->fail(t('No exception was thrown.'));
} catch (Exception $e) {
$this
->assertTrue($e instanceof MethodNotAllowedException, 'The correct exception was thrown.');
}
}