/**
     * Setup environment
     */
    public function setUp()
    {
        $this->xml = <<<EOX
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
    <methodName>test.userUpdate</methodName>
    <params>
        <param>
            <value><string>blahblahblah</string></value>
        </param>
        <param>
            <value><struct>
                <member>
                    <name>salutation</name>
                    <value><string>Felsenblöcke</string></value>
                </member>
                <member>
                    <name>firstname</name>
                    <value><string>Lépiné</string></value>
                </member>
                <member>
                    <name>lastname</name>
                    <value><string>Géranté</string></value>
                </member>
                <member>
                    <name>company</name>
                    <value><string>Zend Technologies, Inc.</string></value>
                </member>
            </struct></value>
        </param>
    </params>
</methodCall>
EOX;
        $this->request = new Zend_XmlRpc_Request_Http();
        $this->request->loadXml($this->xml);
        $this->server = $_SERVER;
        foreach ($_SERVER as $key => $value) {
            if ('HTTP_' == substr($key, 0, 5)) {
                unset($_SERVER[$key]);
            }
        }
        $_SERVER['HTTP_USER_AGENT'] = 'Zend_XmlRpc_Client';
        $_SERVER['HTTP_HOST'] = 'localhost';
        $_SERVER['HTTP_CONTENT_TYPE'] = 'text/xml';
        $_SERVER['HTTP_CONTENT_LENGTH'] = strlen($this->xml) + 1;
        Zend_AllTests_StreamWrapper_PhpInput::mockInput($this->xml);
    }
Пример #2
0
 /**
  * @group ZF-7756
  */
 public function testCallingGetRawBodyMultipleTimesShouldReturnSameValue()
 {
     require_once 'Zend/AllTests/StreamWrapper/PhpInput.php';
     Zend_AllTests_StreamWrapper_PhpInput::mockInput('foobar');
     $request = new Zend_Controller_Request_Http();
     $first = $request->getRawBody();
     $this->assertSame($first, $request->getRawBody());
     stream_wrapper_restore('php');
 }