You are here

public function CandidatesTest::testGetCandidatesLocales in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/routing/Tests/Candidates/CandidatesTest.php \Symfony\Cmf\Component\Routing\Tests\Candidates\CandidatesTest::testGetCandidatesLocales()

File

vendor/symfony-cmf/routing/Tests/Candidates/CandidatesTest.php, line 56

Class

CandidatesTest

Namespace

Symfony\Cmf\Component\Routing\Tests\Candidates

Code

public function testGetCandidatesLocales() {
  $candidates = new Candidates(array(
    'de',
    'fr',
  ));
  $request = Request::create('/fr/path.html');
  $paths = $candidates
    ->getCandidates($request);
  $this
    ->assertEquals(array(
    '/fr/path.html',
    '/fr/path',
    '/fr',
    '/',
    '/path.html',
    '/path',
  ), $paths);
  $request = Request::create('/it/path.html');
  $paths = $candidates
    ->getCandidates($request);
  $this
    ->assertEquals(array(
    '/it/path.html',
    '/it/path',
    '/it',
    '/',
  ), $paths);
}