com phpruntests: Add a check to skip a CGI test if the executable has not been set: src/testcase/sections/executablesections/rtFileSection.php
| From: | David Soria Parra | Date: | Sun, 26 Apr 2009 07:13:36 +0000 |
| Subject: | com phpruntests: Add a check to skip a CGI test if the executable has not been set: src/testcase/sections/executablesections/rtFileSection.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66518@lists.php.net to get a copy of this message | ||
Commit: 68bdd58a7cd6da8e16c659ac72437ca23a088ded
Author: Zoe Slattery <zoe@php.net> Sun, 26 Apr 2009 07:13:36 +0000
Parents: 2e850dbf5692889f257a779bd66e6f6f63515bec
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=68bdd58a7cd6da8e16c659ac72437ca23a088ded
Log:
Add a check to skip a CGI test if the executable has not been set
Changed paths:
M src/testcase/sections/executablesections/rtFileSection.php
Diff:
diff --git a/src/testcase/sections/executablesections/rtFileSection.php
b/src/testcase/sections/executablesections/rtFileSection.php
index 4120d60..118673a 100644
--- a/src/testcase/sections/executablesections/rtFileSection.php
+++ b/src/testcase/sections/executablesections/rtFileSection.php
@@ -16,22 +16,29 @@ class rtFileSection extends rtExecutableSection
$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;
}
}