cvs: phpruntests /tests/testcase/sections/configurationsections rtPostRawSectionTest.php
| From: | Zoe Slattery | Date: | Mon, 04 May 2009 15:45:55 +0000 |
| Subject: | cvs: phpruntests /tests/testcase/sections/configurationsections rtPostRawSectionTest.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57513@lists.php.net to get a copy of this message | ||
zoe Mon May 4 15:45:55 2009 UTC
Added files:
/phpruntests/tests/testcase/sections/configurationsections
rtPostRawSectionTest.php
Log:
test for post raw section
http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/sections/configurationsections/rtPostRawSectionTest.php?view=markup&rev=1.1
Index: phpruntests/tests/testcase/sections/configurationsections/rtPostRawSectionTest.php
+++ phpruntests/tests/testcase/sections/configurationsections/rtPostRawSectionTest.php
<?php
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php';
class rtPostRawSectionTest extends PHPUnit_Framework_TestCase
{
public function testCreateInstance()
{
$post_array = array( 'fred',
'Content-Type:the first',
'joe',
'Content-Type:the second',
'mary',
);
$postSection = new rtPostRawSection('POST', $post_array);
$envVars = $postSection->getPostVariables();
$this->assertEquals('POST', $envVars['REQUEST_METHOD']);
$this->assertEquals('the first',$envVars['CONTENT_TYPE']);
$fileName = $postSection->getPostFileName();
$string = file_get_contents($fileName);
$this->assertEquals('fred\njoe\nContent-Type:the second\nmary', $string);
}
}
?>