You are here

public function RouteCompilerTest::provideCompileWithHostData in Zircon Profile 8

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

File

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

Class

RouteCompilerTest

Namespace

Symfony\Component\Routing\Tests

Code

public function provideCompileWithHostData() {
  return array(
    array(
      'Route with host pattern',
      array(
        '/hello',
        array(),
        array(),
        array(),
        'www.example.com',
      ),
      '/hello',
      '#^/hello$#s',
      array(),
      array(),
      array(
        array(
          'text',
          '/hello',
        ),
      ),
      '#^www\\.example\\.com$#si',
      array(),
      array(
        array(
          'text',
          'www.example.com',
        ),
      ),
    ),
    array(
      'Route with host pattern and some variables',
      array(
        '/hello/{name}',
        array(),
        array(),
        array(),
        'www.example.{tld}',
      ),
      '/hello',
      '#^/hello/(?P<name>[^/]++)$#s',
      array(
        'tld',
        'name',
      ),
      array(
        'name',
      ),
      array(
        array(
          'variable',
          '/',
          '[^/]++',
          'name',
        ),
        array(
          'text',
          '/hello',
        ),
      ),
      '#^www\\.example\\.(?P<tld>[^\\.]++)$#si',
      array(
        'tld',
      ),
      array(
        array(
          'variable',
          '.',
          '[^\\.]++',
          'tld',
        ),
        array(
          'text',
          'www.example',
        ),
      ),
    ),
    array(
      'Route with variable at beginning of host',
      array(
        '/hello',
        array(),
        array(),
        array(),
        '{locale}.example.{tld}',
      ),
      '/hello',
      '#^/hello$#s',
      array(
        'locale',
        'tld',
      ),
      array(),
      array(
        array(
          'text',
          '/hello',
        ),
      ),
      '#^(?P<locale>[^\\.]++)\\.example\\.(?P<tld>[^\\.]++)$#si',
      array(
        'locale',
        'tld',
      ),
      array(
        array(
          'variable',
          '.',
          '[^\\.]++',
          'tld',
        ),
        array(
          'text',
          '.example',
        ),
        array(
          'variable',
          '',
          '[^\\.]++',
          'locale',
        ),
      ),
    ),
    array(
      'Route with host variables that has a default value',
      array(
        '/hello',
        array(
          'locale' => 'a',
          'tld' => 'b',
        ),
        array(),
        array(),
        '{locale}.example.{tld}',
      ),
      '/hello',
      '#^/hello$#s',
      array(
        'locale',
        'tld',
      ),
      array(),
      array(
        array(
          'text',
          '/hello',
        ),
      ),
      '#^(?P<locale>[^\\.]++)\\.example\\.(?P<tld>[^\\.]++)$#si',
      array(
        'locale',
        'tld',
      ),
      array(
        array(
          'variable',
          '.',
          '[^\\.]++',
          'tld',
        ),
        array(
          'text',
          '.example',
        ),
        array(
          'variable',
          '',
          '[^\\.]++',
          'locale',
        ),
      ),
    ),
  );
}