From 4499420ff21691099d103e6e882c877ecff0ad5e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 16 Jul 2009 23:55:46 +0000 Subject: [PATCH] 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 --- tests/PhpSyntaxTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/PhpSyntaxTest.php b/tests/PhpSyntaxTest.php index 7de2e3bd1..dc42cd201 100644 --- a/tests/PhpSyntaxTest.php +++ b/tests/PhpSyntaxTest.php @@ -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})"); } } }