Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin committed Jun 29, 2015
1 parent 84f9bce commit 22e76ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tests/Router/Fixture/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ enUK_only:

sub_locale:
pattern: /english

multiple_locale:
pattern: /multiple_locale
11 changes: 11 additions & 0 deletions Tests/Router/I18nRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ public function testMatchCallsLocaleResolverIfRouteSupportsMultipleLocalesAndCon
$this->assertSame('de', $params['_locale']);
}

public function testMultipleLocale()
{
$router = $this->getNonRedirectingHostMapRouter();

$context = new RequestContext('/', 'GET', 'uk.test');
$context->setParameter('_locale', 'en');
$router->setContext($context);

$this->assertEquals(array('_locale' => 'en_UK', '_route' => 'multiple_locale'), $router->match('/multiple_locale'));
}

private function getRouter($config = 'routing.yml', $translator = null, $localeResolver = null)
{
$container = new Container();
Expand Down

0 comments on commit 22e76ac

Please sign in to comment.