From b4921db9d70401e7d48ac343d65ae60ee27d7e2c Mon Sep 17 00:00:00 2001
From: Sam Minnee
You can change the template or download another from the SilverStripe website after installation.
diff --git a/tests/PhpSyntaxTest.php b/tests/PhpSyntaxTest.php new file mode 100644 index 000000000..d789926b7 --- /dev/null +++ b/tests/PhpSyntaxTest.php @@ -0,0 +1,36 @@ +getAllFiles('php'); + $files[] = '../sapphire/dev/install/config-form.html'; + + foreach($files as $i => $file) { + $CLI_file = escapeshellarg($file); + foreach($settingTests as $settingTest) { + $returnCode = 0; + $output = array(); + exec("php -l -d $settingTest $CLI_file", $output, $returnCode); + $this->assertEquals(0, $returnCode, "Syntax error parsing $CLI_file with setting $settingTest:\n" . implode("\n", $output)); + } + } + } + + function getAllFiles($ext = 'php') { + // TODO: Unix only + $CLI_regexp = escapeshellarg("\.$ext\$"); + return explode("\n", trim(`find .. | grep $CLI_regexp`)); + } +} \ No newline at end of file diff --git a/tests/i18n/_fakewebroot/i18nothermodule/code/i18nOtherModule.php b/tests/i18n/_fakewebroot/i18nothermodule/code/i18nOtherModule.php index f521ea117..9021aee3e 100644 --- a/tests/i18n/_fakewebroot/i18nothermodule/code/i18nOtherModule.php +++ b/tests/i18n/_fakewebroot/i18nothermodule/code/i18nOtherModule.php @@ -3,7 +3,7 @@ class i18nOtherModule extends Object { function mymethod() { _t( 'i18nOtherModule.ENTITY', - 'Other Module Entity', + 'Other Module Entity' ); } }