/**
  * @expectedException Symfony\Component\Routing\Exception\MethodNotAllowedException
  */
 public function testNotAllowed()
 {
     // do not set a content here, or we need a valid request and so on...
     $route = new Route();
     $route->setName('not_allowed');
     $route->setController('testController');
     $route->setRequirement('_method', 'GET');
     $route->setPath('/notallowed');
     self::$em->persist($route);
     self::$em->flush();
     self::$router->getContext()->setMethod('POST');
     self::$router->match('/notallowed');
 }