You are here

public function TraceableUrlMatcherTest::testMatchRouteOnMultipleHosts in Zircon Profile 8

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

File

vendor/symfony/routing/Tests/Matcher/TraceableUrlMatcherTest.php, line 61

Class

TraceableUrlMatcherTest

Namespace

Symfony\Component\Routing\Tests\Matcher

Code

public function testMatchRouteOnMultipleHosts() {
  $routes = new RouteCollection();
  $routes
    ->add('first', new Route('/mypath/', array(
    '_controller' => 'MainBundle:Info:first',
  ), array(), array(), 'some.example.com'));
  $routes
    ->add('second', new Route('/mypath/', array(
    '_controller' => 'MainBundle:Info:second',
  ), array(), array(), 'another.example.com'));
  $context = new RequestContext();
  $context
    ->setHost('baz');
  $matcher = new TraceableUrlMatcher($routes, $context);
  $traces = $matcher
    ->getTraces('/mypath/');
  $this
    ->assertSame(array(
    TraceableUrlMatcher::ROUTE_ALMOST_MATCHES,
    TraceableUrlMatcher::ROUTE_ALMOST_MATCHES,
  ), $this
    ->getLevels($traces));
}