Skip to content

Commit a2fb73f

Browse files
committed
Remove tests for help_ files
1 parent 04c86e4 commit a2fb73f

File tree

2 files changed

+1
-144
lines changed

2 files changed

+1
-144
lines changed

src/Phpbb/TranslationValidator/Validator/FileValidator.php

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,6 @@ public function validate($sourceFile, $originFile)
248248
{
249249
$this->validateEmail($sourceFile, $originFile);
250250
}
251-
else if ($originFile == $this->originLanguagePath . 'search_synonyms.php')
252-
{
253-
$this->validateSearchSynonymsFile($originFile);
254-
}
255-
else if ($originFile == $this->originLanguagePath . 'search_ignore_words.php')
256-
{
257-
$this->validateSearchIgnoreWordsFile($originFile);
258-
}
259251
else if (substr($originFile, -4) === '.php')
260252
{
261253
$this->validateLangFile($sourceFile, $originFile);
@@ -490,96 +482,7 @@ public function validateEmail($sourceFile, $originFile)
490482
$this->output->addMessage(Output::FATAL, 'Missing new line at the end of the file', $originFile);
491483
}
492484
}
493-
494-
/**
495-
* Validates the search_synonyms.php file
496-
*
497-
* Files must only contain the variable $synonyms.
498-
* This variable must be an array of string => string entries.
499-
*
500-
* @todo Check for template vars and html
501-
*
502-
* @param string $originFile File to validate
503-
* @return null
504-
*/
505-
public function validateSearchSynonymsFile($originFile)
506-
{
507-
$originFilePath = $this->originPath . '/' . $originFile;
508-
509-
if (!$this->safeMode)
510-
{
511-
/** @var $synonyms */
512-
include($originFilePath);
513-
514-
$defined_variables = get_defined_vars();
515-
if (sizeof($defined_variables) != 3 || !isset($defined_variables['synonyms']) || gettype($defined_variables['synonyms']) != 'array')
516-
{
517-
$this->output->addMessage(Output::FATAL, 'Must only contain the synonyms-array', $originFile);
518-
return;
519-
}
520-
}
521-
522-
else
523-
{
524-
/** @var $synonyms */
525-
$synonyms = ValidatorRunner::langParser($originFilePath);
526-
$this->output->addMessage(Output::NOTICE, '<bg=yellow;options=bold>[Safe Mode]</> Manually run the translation validator to check synonym variables.', $originFile);
527-
}
528-
529-
foreach ($synonyms as $synonym1 => $synonym2)
530-
{
531-
if (gettype($synonym1) != 'string' || gettype($synonym2) != 'string')
532-
{
533-
$this->output->addMessage(Output::FATAL, 'Must only contain entries of type string => string: ' . serialize($synonym1) . ' => ' . serialize($synonym2), $originFile);
534-
}
535-
}
536-
}
537-
538-
/**
539-
* Validates the search_ignore_words.php file
540-
*
541-
* Files must only contain the variable $words.
542-
* This variable must be an array of string entries.
543-
*
544-
* @todo Check for template vars and html
545-
*
546-
* @param string $originFile File to validate
547-
* @return null
548-
*/
549-
public function validateSearchIgnoreWordsFile($originFile)
550-
{
551-
$originFilePath = $this->originPath . '/' . $originFile;
552-
553-
if (!$this->safeMode)
554-
{
555-
/** @var $words */
556-
include($originFilePath);
557-
558-
$defined_variables = get_defined_vars();
559-
if (sizeof($defined_variables) != 3 || !isset($defined_variables['words']) || gettype($defined_variables['words']) != 'array')
560-
{
561-
$this->output->addMessage(Output::FATAL, 'Must only contain the words-array', $originFile);
562-
return;
563-
}
564-
}
565-
566-
else
567-
{
568-
/** @var $words */
569-
$words = ValidatorRunner::langParser($originFilePath);
570-
$this->output->addMessage(Output::NOTICE, '<bg=yellow;options=bold>[Safe Mode]</> Manually run the translation validator to check word variables.', $originFile);
571-
}
572-
573-
foreach ($words as $word)
574-
{
575-
if (gettype($word) != 'string')
576-
{
577-
//@todo use $i
578-
$this->output->addMessage(Output::FATAL, 'Must only contain entries of type string: ' . serialize($word), $originFile);
579-
}
580-
}
581-
}
582-
485+
583486
/**
584487
* Validates the LICENSE file
585488
*

tests/FileValidator/ValidateHelpTest.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)