示例#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);
 }
示例#2
0
 public function testRestrictions()
 {
     $data = ['controller' => '\\w+', 'id' => '\\d+'];
     $this->route->setRestrictions($data);
     self::assertEquals($data, $this->route->getRestrictions());
 }