Exemplo n.º 1
0
 public function testAllMethodsNoConnection()
 {
     $http = new Http(array('socket' => false));
     $this->assertNotEmpty($http->connect());
     $this->assertNotEmpty($http->disconnect());
     $this->assertEmpty($http->get());
     $this->assertEmpty($http->post());
     $this->assertEmpty($http->put());
 }
Exemplo n.º 2
0
 public function testPost()
 {
     $http = new Http($this->_testConfig);
     $http->post('add.xml', array('status' => 'cool'));
     $expected = join("\r\n", array('POST /add.xml HTTP/1.1', 'Host: localhost:80', 'Connection: Close', 'User-Agent: Mozilla/5.0', 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: 11', '', 'status=cool'));
     $result = (string) $http->last->request;
     $this->assertEqual($expected, $result);
 }