You are here

public function RouteCompilerTest::testCompileWithHost in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Tests/RouteCompilerTest.php \Symfony\Component\Routing\Tests\RouteCompilerTest::testCompileWithHost()

@dataProvider provideCompileWithHostData

File

vendor/symfony/routing/Tests/RouteCompilerTest.php, line 186

Class

RouteCompilerTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testCompileWithHost($name, $arguments, $prefix, $regex, $variables, $pathVariables, $tokens, $hostRegex, $hostVariables, $hostTokens) {
  $r = new \ReflectionClass('Symfony\\Component\\Routing\\Route');
  $route = $r
    ->newInstanceArgs($arguments);
  $compiled = $route
    ->compile();
  $this
    ->assertEquals($prefix, $compiled
    ->getStaticPrefix(), $name . ' (static prefix)');
  $this
    ->assertEquals($regex, str_replace(array(
    "\n",
    ' ',
  ), '', $compiled
    ->getRegex()), $name . ' (regex)');
  $this
    ->assertEquals($variables, $compiled
    ->getVariables(), $name . ' (variables)');
  $this
    ->assertEquals($pathVariables, $compiled
    ->getPathVariables(), $name . ' (path variables)');
  $this
    ->assertEquals($tokens, $compiled
    ->getTokens(), $name . ' (tokens)');
  $this
    ->assertEquals($hostRegex, str_replace(array(
    "\n",
    ' ',
  ), '', $compiled
    ->getHostRegex()), $name . ' (host regex)');
  $this
    ->assertEquals($hostVariables, $compiled
    ->getHostVariables(), $name . ' (host variables)');
  $this
    ->assertEquals($hostTokens, $compiled
    ->getHostTokens(), $name . ' (host tokens)');
}