/**
  * Extract titles for translation
  *
  * @param string                                          $directory
  * @param \Symfony\Component\Translation\MessageCatalogue $catalogue
  *
  * @return MessageCatalogue
  */
 public function extract($directory, MessageCatalogue $catalogue)
 {
     $routes = $this->getRoutesByBundleDir($directory);
     $titles = $this->titleService->getStoredTitlesRepository()->getTitles($routes);
     foreach ($titles as $titleRecord) {
         $message = $titleRecord['title'];
         $catalogue->set($message, $this->prefix . $message);
     }
     return $catalogue;
 }
 public function testGetSerialized()
 {
     $testValue = 'test value';
     $this->serializer->expects($this->once())->method('serialize')->with($this->isInstanceOf('\\Oro\\Bundle\\NavigationBundle\\Title\\StoredTitle'), $this->equalTo('json'))->will($this->returnValue($testValue));
     $result = $this->titleService->getSerialized();
     $this->assertEquals($testValue, $result);
 }
 public function getTitleService()
 {
     $this->titleService = $this->getMock('Oro\\Bundle\\NavigationBundle\\Provider\\TitleServiceInterface');
     $this->titleService->expects($this->once())->method('getSerialized')->will($this->returnValue($this->serializedTitle));
     return $this->titleService;
 }