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.4&r2=1.5&diff_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

Reply via email to