* @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:----egzxFiXzvcQtcUs9VBN9qDqZduNwXVpp7FyV6Pd7DnLfs7qufk0JFUP3r8tfCzzrJdIcFzZjBtaADKvFIy9+N/N/WjpZhA+MlBtJUsdl2pvgQm4rdXoguAwLA5g7i89SW4wCQzdgpD4PntLyVjiNJ1yj/MJJprxg7SjUlnuuSXUQga4QkZALx5D6uFRHwCclYtOZEWMidglaFEm2M9dzPQV2RD1/yXViHRydsrmbhmQOyv/eo7wIrrJ2gCT7CjIjRSAD+PNRAdQE1NeFhwSqKhH8SYnkK/lrM+poqM0452kyGfoGhTtKIabZfJ69rZdnHBX+VewCnydxZxzvZD4C3pFeNhPvQ1cMn9HpNAI8lxalTJe8iGYICyZXHsuD2yTGCVDJLCTRCzFH0JxTTmy5OgBTO2yKbrfI81yf53yqbvDmfgzKeaJukVQuWOc9YFpyRn2ibz7+CZ+FfFPAigloVnXpOmWncGErlN7V6ymbvCyXG99Gg8oN7aLGg6LxsGQ/ohAXyD45IeSWVCFRvhPQp/Ym3HMN2ONmiD+0bCgYHTYcciTS/PfvDz9JiDKS4Ya0uhSeUPgT0SMZwjhpa5QOlHR6sPhvoNxQm0T8jIzmXG2fINY/Ude3KINFcHKAUBt5YzL4sZXDg3TSrlrqYIuYRKIw/+mQPzVDQri7Yt5gynE=----ATTACHMENT:----NzMyNTY0NzU1NDQyNzc5NyA2ODU5NTk2NzEyMDI2MjA4IDg4ODc2MjM3Mjc0MzU5Mzg=