Ejemplo n.º 1
0
 /**
  * Test that the where method in the Route Object
  * works.
  *
  * @return void
  */
 public function testWhereFunctionInRoute()
 {
     $route = new Route('GET', '/foobar/{month}', ['uses' => 'AcmeController::index']);
     $route->where(['month' => '[0-9]{4}-[0-9]{2}']);
     $this->assertEquals('[0-9]{4}-[0-9]{2}', $route->getRequirement('month'));
 }
 /**
  * Create new Exception.
  *
  * @param \Lampsace\Modules\Routing\Route $route
  * @param int                             $code
  * @param Exception|null                  $previous
  */
 public function __construct($route, $code = 400, Exception $previous = null)
 {
     parent::__construct('Unsupported Route parameter in handler for [Route: {' . $route->getName() . '}] [URI: {' . $route->getPath() . '}].', $code, $previous);
 }