/**
  * Test consistent normalization of translation files on disk. This tests not
  * only the functionality of ExtendedIniNormalizer but also the integrity of
  * the language files themselves.
  *
  * @return void
  */
 public function testLanguageFileIntegrity()
 {
     $normalizer = new ExtendedIniNormalizer();
     $langDir = realpath(__DIR__ . '/../../../../../../../languages');
     $handle = opendir($langDir);
     while ($file = readdir($handle)) {
         if (substr($file, -4) == '.ini') {
             $full = $langDir . '/' . $file;
             $this->assertEquals($normalizer->normalizeFileToString($full), file_get_contents($full), $file);
         }
     }
     closedir($handle);
 }
 /**
  * Normalizer
  *
  * @return \Zend\Console\Response
  */
 public function normalizeAction()
 {
     // Display help message if parameters missing:
     $argv = $this->consoleOpts->getRemainingArgs();
     if (!isset($argv[0])) {
         Console::writeLine("Usage: {$_SERVER['argv'][0]} [target]");
         Console::writeLine("\ttarget - a file or directory to normalize");
         return $this->getFailureResponse();
     }
     $normalizer = new ExtendedIniNormalizer();
     $target = $argv[0];
     if (is_dir($target)) {
         $normalizer->normalizeDirectory($target);
     } else {
         if (is_file($target)) {
             $normalizer->normalizeFile($target);
         } else {
             Console::writeLine("{$target} does not exist.");
             return $this->getFailureResponse();
         }
     }
     return $this->getSuccessResponse();
 }