コード例 #1
0
 /**
  * @dataProvider validateFileListData
  */
 public function testValidateFileList($phpbbVersion, $expected)
 {
     $this->validator->setPhpbbVersion($phpbbVersion)->validate();
     $this->assertOutputMessages($expected);
 }
コード例 #2
0
 /**
  * Run the actual test suite.
  */
 public function runValidators()
 {
     $filelistValidator = new FileListValidator($this->input, $this->output);
     $validateFiles = $filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)->setPhpbbVersion($this->phpbbVersion)->setDebug($this->debug)->validate();
     if (empty($validateFiles)) {
         $this->output->writelnIfDebug('');
         $this->output->writelnIfDebug("<fatal>No files found for validation.</fatal>");
         return;
     }
     $pluralRule = $this->guessPluralRule();
     $this->output->writelnIfDebug("<notice>Using plural rule #{$pluralRule} for validation.</notice>");
     $this->output->writelnIfDebug('');
     $this->output->writelnIfDebug("Validating file list:");
     $this->printErrorLevel($this->output);
     $this->maxProgress = sizeof($validateFiles) + 1;
     $this->progressLength = 11 + strlen($this->maxProgress) * 2;
     $filelistValidator = new FileValidator($this->input, $this->output);
     $filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)->setPhpbbVersion($this->phpbbVersion)->setPluralRule($pluralRule)->setDebug($this->debug);
     foreach ($validateFiles as $sourceFile => $originFile) {
         $this->output->writelnIfDebug('');
         $this->output->writelnIfDebug("Validating file: {$originFile}");
         $filelistValidator->validate($sourceFile, $originFile);
         $this->printErrorLevel($this->output);
         usleep(31250);
         //125000);
     }
     $this->output->writeln('.');
 }