[PHP-CVS] cvs: phpruntests /tests/testcase rtGetExecutionTest.php

2009-05-14 Thread Zoe Slattery
zoe Thu May 14 11:35:18 2009 UTC

  Modified files:  
/phpruntests/tests/testcase rtGetExecutionTest.php 
  Log:
  fixing cgi check
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/rtGetExecutionTest.php?r1=1.2&r2=1.3&diff_format=u
Index: phpruntests/tests/testcase/rtGetExecutionTest.php
diff -u phpruntests/tests/testcase/rtGetExecutionTest.php:1.2 
phpruntests/tests/testcase/rtGetExecutionTest.php:1.3
--- phpruntests/tests/testcase/rtGetExecutionTest.php:1.2   Mon May 11 
11:03:26 2009
+++ phpruntests/tests/testcase/rtGetExecutionTest.php   Thu May 14 11:35:18 2009
@@ -24,7 +24,7 @@
 }
 
 public function testFileRun()
-{ 
+{
 //Create a new test configuration
 $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', 
'-p', $this->php, $this->sample_test));
 
$config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi);
@@ -39,16 +39,47 @@
 $testFile->normaliseLineEndings();
 
 //Create a new test case
-$testCase = new rtPhpTest($testFile->getContents(), 
$testFile->getTestName(), $testFile->getSectionHeadings(), $config);  
+$testCase = new rtPhpTest($testFile->getContents(), 
$testFile->getTestName(), $testFile->getSectionHeadings(), $config);
 
 //Setup and set the local environment for the test case
 $testCase->executeTest($config);
 $output = $testCase->getOutput();
 $status = $testCase->getStatus();
-   
+ 
 $this->assertEquals('85', strlen($output));
 $this->assertEquals('', $status['pass']);
+
+
+}
+
+public function testNoCGI()
+{
+//Create a new test configuration
+$config = rtRuntestsConfiguration::getInstance(array('run-tests.php', 
'-p', $this->php, $this->sample_test));
+$config->configure();
+
+//Retrieve the array of test file names
+$testFiles = $config->getSetting('TestFiles');
+
+//Read the test file
+$testFile = new rtPhpTestFile();
+$testFile->doRead($testFiles[0]);
+$testFile->normaliseLineEndings();
+
+//Create a new test case
+$testCase = new rtPhpTest($testFile->getContents(), 
$testFile->getTestName(), $testFile->getSectionHeadings(), $config);
+
+//Setup and set the local environment for the test case
+$testCase->executeTest($config);
+$output = $testCase->getOutput();
+//var_dump($output);
 
+$status = $testCase->getStatus();
+ 
+ 
+$this->assertEquals(0, strlen($output));
+$this->assertEquals('The CGI executable is unavailable', 
$status['skip']);
+
 
 }
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: phpruntests /tests/testcase rtGetExecutionTest.php

2009-04-26 Thread Zoe Slattery
zoe Sun Apr 26 22:44:55 2009 UTC

  Added files: 
/phpruntests/tests/testcase rtGetExecutionTest.php 
  Log:
  Changes to enable GET
  

http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/rtGetExecutionTest.php?view=markup&rev=1.1
Index: phpruntests/tests/testcase/rtGetExecutionTest.php
+++ phpruntests/tests/testcase/rtGetExecutionTest.php
php = trim(shell_exec("which php"));
$this->php_cgi = trim(shell_exec("which php-cgi"));

$this->path_to_tests = realpath(dirname(__FILE__) . 
'/../../phpt-tests');
$this->sample_test = $this->path_to_tests . '/sample_get.phpt';
}

public function tearDown()
{
@unlink($this->path-to_tests . '/sample_get.php');
}

public function testFileRun()
{ 
//Create a new test configuration
$config = rtRuntestsConfiguration::getInstance(array('run-tests.php', 
'-p', $this->php, $this->sample_test));

$config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi);
$config->configure();

//Retrieve the array of test file names
$testFiles = $config->getSetting('TestFiles');

//Read the test file
$testFile = new rtPhpTestFile();
$testFile->doRead($testFiles[0]);
$testFile->normaliseLineEndings();

//Create a new test case
$testCase = new rtPhpTest($testFile->getContents(), 
$testFile->getTestName(), $testFile->getSectionHeadings(), $config);  

//Setup and set the local environment for the test case
$testCase->executeTest($config);
$output = $testCase->getOutput();
$status = $testCase->getStatus();
   
$this->assertEquals('85', strlen($output));
$this->assertEquals('', $status['pass']);


}
}

?>
?>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php