Ejemplo n.º 1
0
 public function testCustomPostMethodWithModel()
 {
     $config = $this->_testConfig + array('methods' => array('do' => array('method' => 'post', 'path' => '/do')));
     $http = new Http($config);
     $query = new Query(array('model' => $this->_model, 'data' => array('title' => 'sup')));
     $result = $http->do($query);
     $expected = join("\r\n", array('POST /do HTTP/1.1', 'Host: localhost:80', 'Connection: Close', 'User-Agent: Mozilla/5.0', 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: 9', '', 'title=sup'));
     $result = (string) $http->last->request;
     $this->assertEqual($expected, $result);
 }