You are here

public function RouteTest::testCompile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/RouteTest.php \Symfony\Component\Routing\Tests\RouteTest::testCompile()

File

vendor/symfony/routing/Tests/RouteTest.php, line 218

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testCompile() {
  $route = new Route('/{foo}');
  $this
    ->assertInstanceOf('Symfony\\Component\\Routing\\CompiledRoute', $compiled = $route
    ->compile(), '->compile() returns a compiled route');
  $this
    ->assertSame($compiled, $route
    ->compile(), '->compile() only compiled the route once if unchanged');
  $route
    ->setRequirement('foo', '.*');
  $this
    ->assertNotSame($compiled, $route
    ->compile(), '->compile() recompiles if the route was modified');
}