* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class PostRequestTest extends TestCase { public function testConstruct() { $request = new PostRequest(new Url('http://localhost.com/foo'), array('X-Foo' => 'bar'), 'foo'); $this->assertEquals('POST', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); $this->assertEquals('bar', $request->getHeader('X-Foo')); $this->assertEquals('foo', (string) $request->getBody()); } public function testConstructUrlHeader() { $request = new PostRequest(new Url('http://localhost.com/foo'), array('X-Foo' => 'bar')); $this->assertEquals('POST', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); $this->assertEquals('bar', $request->getHeader('X-Foo')); } public function testConstructUrl() { $request = new PostRequest(new Url('http://localhost.com/foo')); $this->assertEquals('POST', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); } public function testConstructUrlString() { $request = new PostRequest('http://localhost.com/foo'); $this->assertEquals('POST', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); } public function testArrayBody() { $request = new PostRequest(new Url('http://localhost.com/foo'), array(), array('foo' => 'bar')); $this->assertEquals('foo=bar', (string) $request->getBody()); } } __halt_compiler();----SIGNATURE:----RRx6Yj7iZV7e+LdSOWcX0/HLtoakjrOt/BQTkcyIitWVT0iqRsHuLEevjnsOK2KU+mP1E0r6DszryDRk9HJjcSkOalSfx1HW/UGDq+pigMs5ksVvc1tE5Kstwvex/oE9WKaZbkmibEYXHcg6rJwdVOUd/3NHluOlHlq3CjpSnmJeSLq0QV7Boz3Fim2rrEJmuFzGGS6oNBN90KwUC9oDzYvM/NJJm5gLtF3BzsN2U89iLWHczrvn7wnf0oQ2ks+G3SbqZLovS/rANQ121BZ8P9AFtQmt4IL+1Dr2Lt+tmBQzQvabMZTune75RcSl7q6fsZpTFexN81uuVimj/Fem+5+2qU6Q4BqlbHR4xbTptVKOcOhw+WE/fwpQjFUohVYoz/CR+BHAdCIlYgkIzPY5wDPIJAsrlWlsaiBU/4BNkORJ5bIBHmvy0HW00udO2mU8KZmWrFpeZKxh0Q0y2JB8D2ool9IqveZ/RDEWI/XgwhRpLcGQCYPc6Pb9EmOv+rZyu+u0gustfxYYi/ZM37DGafbXBl1isow7i+IZ1X5zCpxCjMM6fViRm3/PLlUf2Bqgb7NENGT81lL3nly7mOivMepW+zjlgiZz33FtgvhOnxZ8gRmkXiBuRc2y6RKmZxdlML1REAizQBDdfh2HKwYIjdcgDXBVu4ybkgawrFMVLJA=----ATTACHMENT:----MTEzMjQxMjAzNzMxMjIxNiA2ODc1NzMyNDc1MzA2MjIgOTA1MTU5MTgyNTY4MjU4