zoe Thu Apr 30 20:22:22 2009 UTC
Added files:
/phpruntests/tests/testcase rtDeflatePostExecutionTest.php
Modified files:
/phpruntests/src/testcase/preconditions rtIsSectionImplemented.php
/phpruntests/src/testcase rtTestConfiguration.php
/phpruntests/src/testcase/sections rtSection.php
Log:
Deflate post section done
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php?r1=1.4&r2=1.5&diff_format=u
Index: phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php
diff -u phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.4
phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.5
--- phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.4
Tue Apr 28 20:57:48 2009
+++ phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php Thu Apr
30 20:22:22 2009
@@ -18,7 +18,9 @@
'CLEAN' => 'rtCleanSection',
'XFAIL' => 'rtXfailSection',
'GET' => 'rtGetSection',
- 'POST' => 'rtPostSection'
+ 'POST' => 'rtPostSection',
+ 'GZIP_POST' => 'rtGzipPostSection',
+ 'DEFLATE_POST' => 'rtDeflatePostSection',
);
/** Return the message associated with an unimplemented test section
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestConfiguration.php?r1=1.10&r2=1.11&diff_format=u
Index: phpruntests/src/testcase/rtTestConfiguration.php
diff -u phpruntests/src/testcase/rtTestConfiguration.php:1.10
phpruntests/src/testcase/rtTestConfiguration.php:1.11
--- phpruntests/src/testcase/rtTestConfiguration.php:1.10 Thu Apr 30
19:06:50 2009
+++ phpruntests/src/testcase/rtTestConfiguration.php Thu Apr 30 20:22:22 2009
@@ -66,12 +66,15 @@
if (array_key_exists('GET', $sections)) {
$this->environmentVariables =
array_merge($this->environmentVariables, $sections['GET']->getGetVariables());
}
- if (array_key_exists('POST', $sections)) {
+ if (array_key_exists('POST', $sections)) {
$this->environmentVariables =
array_merge($this->environmentVariables, $sections['POST']->getPostVariables());
}
- if (array_key_exists('GZIP_POST', $sections)) {
+ if (array_key_exists('GZIP_POST', $sections)) {
$this->environmentVariables =
array_merge($this->environmentVariables,
$sections['GZIP_POST']->getPostVariables());
}
+ if (array_key_exists('DEFLATE_POST', $sections)) {
+ $this->environmentVariables =
array_merge($this->environmentVariables,
$sections['DEFLATE_POST']->getPostVariables());
+ }
}
@@ -112,6 +115,9 @@
if(in_array('GZIP_POST', $sectionHeadings)) {
$this->inputFileString = '<
'.$sections['GZIP_POST']->getPostFileName();
}
+ if(in_array('DEFLATE_POST', $sectionHeadings)) {
+ $this->inputFileString = '<
'.$sections['DEFLATE_POST']->getPostFileName();
+ }
}
private function isCgiTest($sectionHeadings)
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/rtSection.php?r1=1.5&r2=1.6&diff_format=u
Index: phpruntests/src/testcase/sections/rtSection.php
diff -u phpruntests/src/testcase/sections/rtSection.php:1.5
phpruntests/src/testcase/sections/rtSection.php:1.6
--- phpruntests/src/testcase/sections/rtSection.php:1.5 Thu Apr 30 19:07:22 2009
+++ phpruntests/src/testcase/sections/rtSection.php Thu Apr 30 20:22:22 2009
@@ -21,6 +21,7 @@
'GET' => 'rtGetSection',
'POST' => 'rtPostSection',
'GZIP_POST' => 'rtGzipPostSection',
+ 'DEFLATE_POST' => 'rtDeflatePostSection',
);
protected $sectionName;
http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/rtDeflatePostExecutionTest.php?view=markup&rev=1.1
Index: phpruntests/tests/testcase/rtDeflatePostExecutionTest.php
+++ phpruntests/tests/testcase/rtDeflatePostExecutionTest.php
<?php
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__) . '../../../src/rtAutoload.php';
class rtDeflatePostExecutionTest extends PHPUnit_Framework_TestCase
{
private $sample_test;
public function setUp()
{
$this->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_deflatepost.phpt';
}
public function tearDown()
{
@unlink($this->path-to_tests . '/sample_deflatepost.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('It worked!', trim($output));
$this->assertEquals('', $status['pass']);
}
}
?>
?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php