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);
    }
}
?>


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

Reply via email to