Exemplo n.º 1
0
 public function testRegexpWithResriction()
 {
     $route = new Route('/controller/{action}/', function () {
     });
     $route->setRestrictions(['action' => '\\w+']);
     $regexp = $this->service->makeRegExp($route);
     self::assertEquals('/controller/(?<action>\\w+)/', $regexp);
 }
Exemplo n.º 2
0
 public function testRestrictions()
 {
     $data = ['controller' => '\\w+', 'id' => '\\d+'];
     $this->route->setRestrictions($data);
     self::assertEquals($data, $this->route->getRestrictions());
 }