public function testGetCandidatesLimit() { $candidates = new Candidates(array(), 1); $request = Request::create('/my/path/is/deep.html'); $paths = $candidates->getCandidates($request); $this->assertEquals(array('/my/path/is/deep.html', '/my/path/is/deep'), $paths); }
/** * {@inheritDoc} * * The normal phpcr-odm locale listener "waits" until the routing completes * as the locale is usually defined inside the route. We need to set it * already in case the route document itself is translated. * * For example the CmfSimpleCmsBundle Page documents. */ protected function determineLocale($url) { $locale = parent::determineLocale($url); if ($locale && $this->doctrine) { $this->getDocumentManager()->getLocaleChooserStrategy()->setLocale($locale); } return $locale; }