public function RouteTest::testRequirement in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/RouteTest.php \Symfony\Component\Routing\Tests\RouteTest::testRequirement()
File
- vendor/
symfony/ routing/ Tests/ RouteTest.php, line 115
Class
Namespace
Symfony\Component\Routing\TestsCode
public function testRequirement() {
$route = new Route('/{foo}');
$this
->assertFalse($route
->hasRequirement('foo'), '->hasRequirement() return false if requirement is not set');
$route
->setRequirement('foo', '^\\d+$');
$this
->assertEquals('\\d+', $route
->getRequirement('foo'), '->setRequirement() removes ^ and $ from the path');
$this
->assertTrue($route
->hasRequirement('foo'), '->hasRequirement() return true if requirement is set');
}