public function testXlfExportWithoutPackageId() { $this->export->setLocale('en'); $this->export->setFormat(Export::XLIFF); $this->export->setPath(self::$fixturePath . '/'); $this->export->setFilename('sulu'); $this->export->execute(); $expectedHash = file_get_contents(self::$fixturePath . '/samples/export.all.xlf'); $actualHash = file_get_contents(self::$fixturePath . '/sulu.en.xlf'); $this->assertEquals($expectedHash, $actualHash); }
/** * Executes the command for a given locale. * * @param InputInterface $input The input of the command * @param OutputInterface $output The output of the command * @param $locale string The locale */ private function exportForLocale(InputInterface $input, OutputInterface $output, $locale) { $formatInput = $input->getArgument('format'); $backend = $input->getOption('backend'); $frontend = $input->getOption('frontend'); $path = $input->getOption('path'); $filename = $input->getOption('filename'); $export = new Export($this->getContainer()->get('translator.default'), $output); $export->setLocale($locale); $export->setPath($path); $export->setFilename($filename); $export->setFormat($this->getFormatFromInput($formatInput)); if ($backend) { $export->setBackend(true); } if ($frontend) { $export->setFrontend(true); } $export->execute(); }