From 0ef04790d1ae9d3b27b8d389235f9c5f29b65a95 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 5 Aug 2015 11:30:43 +0200 Subject: renamed test file --- _test/tests/general/general_languagelint.php | 47 ----------------------- _test/tests/general/general_languagelint.test.php | 47 +++++++++++++++++++++++ 2 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 _test/tests/general/general_languagelint.php create mode 100644 _test/tests/general/general_languagelint.test.php (limited to '_test/tests') diff --git a/_test/tests/general/general_languagelint.php b/_test/tests/general/general_languagelint.php deleted file mode 100644 index c11462640..000000000 --- a/_test/tests/general/general_languagelint.php +++ /dev/null @@ -1,47 +0,0 @@ -checkFiles(glob(DOKU_INC.'inc/lang/*/*.php')); - } - - function test_plugins() { - $this->checkFiles(glob(DOKU_INC.'lib/plugins/*/lang/*/*.php')); - } - - /** - * Run checks over the given PHP language files - * - * @param $files - */ - private function checkFiles($files){ - foreach($files as $file){ - // try to load the file - include $file; - // check it defines an array - $this->assertTrue(is_array($lang), $file); - unset($lang); - - $this->checkUgly($file); - } - } - - /** - * Checks if the file contains any ugly things like leading whitespace, BOM or trailing - * PHP closing mark - * - * @param $file - * @throws Exception - */ - private function checkUgly($file){ - $content = rtrim(file_get_contents($file)); - if(substr($content,0,5) != '') - throw new Exception("$file ends with '?>' - remove it!"); - } - -} diff --git a/_test/tests/general/general_languagelint.test.php b/_test/tests/general/general_languagelint.test.php new file mode 100644 index 000000000..c11462640 --- /dev/null +++ b/_test/tests/general/general_languagelint.test.php @@ -0,0 +1,47 @@ +checkFiles(glob(DOKU_INC.'inc/lang/*/*.php')); + } + + function test_plugins() { + $this->checkFiles(glob(DOKU_INC.'lib/plugins/*/lang/*/*.php')); + } + + /** + * Run checks over the given PHP language files + * + * @param $files + */ + private function checkFiles($files){ + foreach($files as $file){ + // try to load the file + include $file; + // check it defines an array + $this->assertTrue(is_array($lang), $file); + unset($lang); + + $this->checkUgly($file); + } + } + + /** + * Checks if the file contains any ugly things like leading whitespace, BOM or trailing + * PHP closing mark + * + * @param $file + * @throws Exception + */ + private function checkUgly($file){ + $content = rtrim(file_get_contents($file)); + if(substr($content,0,5) != '') + throw new Exception("$file ends with '?>' - remove it!"); + } + +} -- cgit v1.2.3