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