예제 #1
0
 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);
 }
예제 #2
0
 /**
  * {@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;
 }