cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php

From: Date: Sun, 26 Apr 2009 07:13:36 +0000
Subject: cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-57268@lists.php.net to get a copy of this message
zoe Sun Apr 26 07:13:36 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: Add a check to skip a CGI test if the executable has not been set http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.2 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.3 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.2 Fri Apr 24 08:41:26 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Sun Apr 26 07:13:36 2009 @@ -16,22 +16,29 @@ $this->setExecutableFileName($testCase->getName()); $this->writeExecutableFile(); - $phpCommand = $runConfiguration->getSetting('PhpExecutable'); - $phpCommand .= ' '.$testCase->testConfiguration->getPhpCommandLineArguments(); - $phpCommand .= ' -f '.$this->fileName; - $phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); + $phpExecutable = $testCase->testConfiguration->getPhpExecutable(); - $PhpRunner = new rtPhpRunner($phpCommand, - $testCase->testConfiguration->getEnvironmentVariables(), + // The CGI excutable is null if it is not available, check and SKIP if appropriate + if ($phpExecutable != null) { + $phpCommand = $phpExecutable; + $phpCommand .= ' '.$testCase->testConfiguration->getPhpCommandLineArguments(); + $phpCommand .= ' -f '.$this->fileName; + $phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); + + $PhpRunner = new rtPhpRunner($phpCommand, + $testCase->testConfiguration->getEnvironmentVariables(), $runConfiguration->getSetting('WorkingDirectory') - ); - - try { - $this->output = $PhpRunner->runphp(); - } catch (rtPhpRunnerException $e) { - $this->status['fail'] = $e->getMessage(); + ); + + try { + $this->output = $PhpRunner->runphp(); + } catch (rtPhpRunnerException $e) { + $this->status['fail'] = $e->getMessage(); + } + } else { + $this->status['skip'] = 'The CGI executable is unavailable'; } - + return $this->status; } }

« previous php.cvs (#57268) next »