Beispiel #1
0
 public function testTest()
 {
     $urlFixture = '/admin/test/';
     $request = new Request();
     $request->uri($urlFixture);
     $config = array('controller' => '\\Extasy\\tests\\Bootstrap\\TestController', 'method' => 'process', 'url' => $urlFixture);
     $route = new Route($config);
     $this->assertTrue((bool) $route->test($request));
     $config['url'] = '/admin/unknown/';
     $route = new Route($config);
     $this->assertFalse((bool) $route->test($request));
 }
Beispiel #2
0
 public function __construct($config = [])
 {
     if (!isset($config['path'])) {
         throw new \InvalidArgumentException('Argument `path` not found');
     }
     $this->filePath = $config['path'];
     parent::__construct($config);
 }