BUGFIX Fixed PhpSyntaxTest? parsing of return value - some PHP versions seem to return a string rather than an error code (merged from branches/2.3-nzct)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82063 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-16 23:55:46 +00:00
parent 485eca829b
commit 4499420ff2

View File

@ -25,7 +25,8 @@ class PhpSyntaxTest extends SapphireTest {
$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));
$hasErrors = ($returnCode != 0 && strpos('No syntax errors detected', $returnCode) === FALSE);
$this->assertFalse($hasErrors, "Syntax error parsing $CLI_file with setting $settingTest:\n" . implode("\n", $output) . " (Returned: {$returnCode})");
}
}
}