Skip to content

Commit

Permalink
Merge pull request #34 from Crizz0/validator-update-for-3.2.x
Browse files Browse the repository at this point in the history
Release 1.3.10
  • Loading branch information
Crizz0 authored Jan 4, 2017
2 parents 4a85e75 + 0fca72f commit dee7d51
Show file tree
Hide file tree
Showing 62 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "phpbb/translation-validator",
"description": "A language package validator for phpBB language packs. Language packs are required to pass the validator when submitted to the language pack database.",
"homepage": "https://github.com/phpbb/phpbb-translation-validator",
"version": "1.3.9",
"version": "1.3.10",
"license": "GPL-2.0",
"authors": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function setUp()
parent::setUp();

$this->validator = new \Phpbb\TranslationValidator\Validator\FileListValidator($this->getMock('Symfony\Component\Console\Input\InputInterface'), $this->output);
$this->validator->setOrigin('origin', dirname(__FILE__) . '/fixtures/origin', 'language/origin/')
->setSource('source', dirname(__FILE__) . '/fixtures/source', 'language/source/');
}

public function validateFileListData()
Expand All @@ -39,11 +37,10 @@ public function validateFileListData()
Output::FATAL . '-Found additional file-subdir/additional.php-',
Output::FATAL . '-Found additional file-additional.txt-',

Output::ERROR . '-Found additional file-language/origin/AUTHORS.md-',
Output::ERROR . '-Found additional file-language/origin/CHANGELOG.md-',
Output::ERROR . '-Found additional file-language/origin/README.md-',
Output::ERROR . '-Found additional file-language/origin/VERSION.md-',

Output::NOTICE . '-Found additional file-language/origin/AUTHORS.md-',
Output::NOTICE . '-Found additional file-language/origin/CHANGELOG.md-',
Output::NOTICE . '-Found additional file-language/origin/README.md-',
Output::NOTICE . '-Found additional file-language/origin/VERSION.md-',
Output::NOTICE . '-Found additional file-language/origin/AUTHORS-',
Output::NOTICE . '-Found additional file-language/origin/CHANGELOG-',
Output::NOTICE . '-Found additional file-language/origin/README-',
Expand Down Expand Up @@ -75,6 +72,28 @@ public function validateFileListData()
Output::NOTICE . '-Found additional file-language/origin/index.htm-',
),
),
array(
'3.2',
array(
Output::FATAL . '-Missing required file-missing.php-',
Output::FATAL . '-Missing required file-missing.txt-',
Output::FATAL . '-Missing required file-subdir/missing.php-',
Output::FATAL . '-Missing required file-language/origin/LICENSE-',
Output::FATAL . '-Found additional file-additional.php-',
Output::FATAL . '-Found additional file-subdir/additional.php-',
Output::FATAL . '-Found additional file-additional.txt-',
Output::FATAL . '-Found additional file-language/origin/AUTHORS-',
Output::FATAL . '-Found additional file-language/origin/CHANGELOG-',
Output::FATAL . '-Found additional file-language/origin/README-',
Output::FATAL . '-Found additional file-language/origin/VERSION-',

Output::NOTICE . '-Found additional file-language/origin/AUTHORS.md-',
Output::NOTICE . '-Found additional file-language/origin/CHANGELOG.md-',
Output::NOTICE . '-Found additional file-language/origin/README.md-',
Output::NOTICE . '-Found additional file-language/origin/VERSION.md-',
Output::NOTICE . '-Found additional file-language/origin/index.htm-',
),
),
);
}

Expand All @@ -83,6 +102,9 @@ public function validateFileListData()
*/
public function testValidateFileList($phpbbVersion, $expected)
{
$this->validator->setOrigin('origin', dirname(__FILE__) . '/fixtures/'. $phpbbVersion . '/origin', 'language/origin/')
->setSource('source', dirname(__FILE__) . '/fixtures/'. $phpbbVersion . '/source', 'language/source/');

$this->validator
->setPhpbbVersion($phpbbVersion)
->validate();
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function validate()
$testSourceFile = str_replace('/' . $this->originIso . '/', '/' . $this->sourceIso . '/', $origin_file);
if (!in_array($testSourceFile, $sourceFiles))
{
if (in_array($origin_file, array(
if (($this->phpbbVersion == '3.0' || $this->phpbbVersion == '3.1') && in_array($origin_file, array(
$this->originLanguagePath . 'AUTHORS',
$this->originLanguagePath . 'CHANGELOG',
$this->originLanguagePath . 'README',
Expand All @@ -176,7 +176,7 @@ public function validate()
{
$this->output->addMessage(Output::NOTICE, 'Found additional file', $origin_file);
}
else if ($this->phpbbVersion == '3.1' && in_array($origin_file, array(
else if (in_array($origin_file, array(
$this->originLanguagePath . 'AUTHORS.md',
$this->originLanguagePath . 'CHANGELOG.md',
$this->originLanguagePath . 'README.md',
Expand Down

0 comments on commit dee7d51

Please sign in to comment.