[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
zoe Sun May 17 12:30:59 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: moving CGI check http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.10r2=1.11diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.10 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.11 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.10 Thu May 14 19:56:30 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Sun May 17 12:30:59 2009 @@ -21,7 +21,7 @@ { $this-fileName = $testName..php; } - + protected function init() { $contents = array(); foreach($this-sectionContents as $line) { @@ -32,7 +32,7 @@ $this-sectionContents = $contents; break; } -} +} } public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) @@ -43,50 +43,53 @@ $phpExecutable = $testCase-testConfiguration-getPhpExecutable(); // The CGI excutable is null if it is not available, check and SKIP if necessary -if ($phpExecutable != null) { -$phpCommand = $phpExecutable; -$phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); -$phpCommand .= ' -f '.$this-fileName; -$phpCommand .= ' '.$testCase-testConfiguration-getTestCommandLineArguments(); -$phpCommand .= ' 21 '.$testCase-testConfiguration-getInputFileString(); - - -$PhpRunner = new rtPhpRunner($phpCommand, -$testCase-testConfiguration-getEnvironmentVariables(), -$runConfiguration-getSetting('WorkingDirectory') -); - -try { -$this-output = $PhpRunner-runphp(); - -//If it's a CGI test and separate the headers from the output -if($testCase-testConfiguration-isCgiTest()) { -// Would this be better done with substr/strpos, not sure how to cope with \n -// Do Web servers alsways send \n\r\n\r? I *think* so but need to check - -if (preg_match(/^(.*?)$this-twoBlankLines(.*)/s, $this-output, $match)) { -$this-output = $match[2]; -$this-headers = $match[1]; -} -} +if (is_null($phpExecutable)) { +$this-status['skip'] = 'The CGI executable is unavailable'; +return $this-status; +} -} catch (rtPhpRunnerException $e) { -$this-status['fail'] = $e-getMessage(); +$phpCommand = $phpExecutable; +$phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); +$phpCommand .= ' -f '.$this-fileName; +$phpCommand .= ' '.$testCase-testConfiguration-getTestCommandLineArguments(); +$phpCommand .= ' 21 '.$testCase-testConfiguration-getInputFileString(); + + +$PhpRunner = new rtPhpRunner($phpCommand, +$testCase-testConfiguration-getEnvironmentVariables(), +$runConfiguration-getSetting('WorkingDirectory') +); + +try { +$this-output = $PhpRunner-runphp(); + +//If it's a CGI test and separate the headers from the output +if($testCase-testConfiguration-isCgiTest()) { +// Would this be better done with substr/strpos, not sure how to cope with \n +// Do Web servers alsways send \n\r\n\r? I *think* so but need to check + +if (preg_match(/^(.*?)$this-twoBlankLines(.*)/s, $this-output, $match)) { +$this-output = $match[2]; +$this-headers = $match[1]; +} } -} else { -$this-status['skip'] = 'The CGI executable is unavailable'; + + +} catch (rtPhpRunnerException $e) { +$this-status['fail'] = $e-getMessage(); } -return $this-status; -} + +return $this-status; +} -/** - * - */ -public function getHeaders() -{ -return $this-headers; -} +/** + * + */ +public function getHeaders() +{ +return $this-headers; +} } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
zoe Tue Apr 28 20:23:43 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: add line to get a post / stdin file http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.6r2=1.7diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.6 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.7 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.6 Mon Apr 27 21:06:20 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Tue Apr 28 20:23:43 2009 @@ -34,6 +34,7 @@ $phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); $phpCommand .= ' -f '.$this-fileName; $phpCommand .= ' '.$testCase-testConfiguration-getTestCommandLineArguments(); +$phpCommand .= ' '.$testCase-testConfiguration-getInputFileString(); $PhpRunner = new rtPhpRunner($phpCommand, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
zoe Tue Apr 28 20:58:39 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: POST implemented http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.7r2=1.8diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.7 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.8 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.7 Tue Apr 28 20:23:43 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Tue Apr 28 20:58:39 2009 @@ -34,7 +34,7 @@ $phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); $phpCommand .= ' -f '.$this-fileName; $phpCommand .= ' '.$testCase-testConfiguration-getTestCommandLineArguments(); -$phpCommand .= ' '.$testCase-testConfiguration-getInputFileString(); +$phpCommand .= ' 21 '.$testCase-testConfiguration-getInputFileString(); $PhpRunner = new rtPhpRunner($phpCommand, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
zoe Mon Apr 27 21:06:20 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: Fixing comment block http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.5r2=1.6diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.5 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.6 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.5 Sun Apr 26 22:44:35 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Mon Apr 27 21:06:20 2009 @@ -1,17 +1,6 @@ ?php /** * rtFileSection - * - * @category Testing - * @package RUNTESTS - * @authorZoe Slattery z...@php.net - * @authorStefan Priebsch sprieb...@php.net - * @copyright 2009 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://qa.php.net/ - */ - -/** * Executes the code in the --FILE-- section * * @@ -39,8 +28,7 @@ $phpExecutable = $testCase-testConfiguration-getPhpExecutable(); - -// The CGI excutable is null if it is not available, check and SKIP if asubstrppropriate +// The CGI excutable is null if it is not available, check and SKIP if necessary if ($phpExecutable != null) { $phpCommand = $phpExecutable; $phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
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.2r2=1.3diff_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; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileSection.php
zoe Sun Apr 26 22:44:35 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: Changes to enable GET http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.4r2=1.5diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.4 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.5 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.4 Sun Apr 26 07:17:14 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Sun Apr 26 22:44:35 2009 @@ -25,6 +25,8 @@ */ class rtFileSection extends rtExecutableSection { +private $twoBlankLines = '\r?\n\r?\n'; + public function setExecutableFileName($testName) { $this-fileName = $testName..php; @@ -33,18 +35,18 @@ public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { $this-status = array(); - -$this-setExecutableFileName($testCase-getName()); $this-writeExecutableFile(); $phpExecutable = $testCase-testConfiguration-getPhpExecutable(); - -// The CGI excutable is null if it is not available, check and SKIP if appropriate + + +// The CGI excutable is null if it is not available, check and SKIP if asubstrppropriate if ($phpExecutable != null) { $phpCommand = $phpExecutable; -$phpCommand .= ' '.$testCase-testConfiguration-getPhpCommandLineArguments(); +$phpCommand .= ' '. $testCase-testConfiguration-getPhpCommandLineArguments(); $phpCommand .= ' -f '.$this-fileName; $phpCommand .= ' '.$testCase-testConfiguration-getTestCommandLineArguments(); + $PhpRunner = new rtPhpRunner($phpCommand, $testCase-testConfiguration-getEnvironmentVariables(), @@ -53,6 +55,18 @@ try { $this-output = $PhpRunner-runphp(); + +//If it's a CGI test sort the headers out here +if(substr($phpExecutable, -2) == '-C') { + +if (preg_match(/^(.*?)$this-twoBlankLines(.*)/s, $this-output, $match)) { +$this-output = $match[2]; +$this-headers = $match[1]; +} + +} + + } catch (rtPhpRunnerException $e) { $this-status['fail'] = $e-getMessage(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php