Example #1
0
 public function testGetTitleMethodForDefaultTitles()
 {
     $app = new Application();
     $files = $app['finder']->files()->name('titles.*.yml')->in($app['app.dir.translations']);
     foreach ($files as $file) {
         $locale = substr($file->getRelativePathname(), -6, 2);
         // reset the application for each language because titles are cached
         $app = new Application();
         $app['publishing.edition'] = 'edition1';
         $app['publishing.book.config'] = array('book' => array('language' => $locale, 'editions' => array('edition1' => array())));
         $titles = Yaml::parse($file->getPathname());
         foreach ($titles['title'] as $key => $expectedValue) {
             $this->assertEquals($expectedValue, $app->getTitle($key));
         }
     }
 }