Permalink
Browse files

Fixing up some more failing tests related to `type()` changes.

  • Loading branch information...
1 parent 0121ca5 commit 13a1e45f02c20b17d9d414786e881c67861c63de @gwoo gwoo committed Sep 27, 2012
Showing with 6 additions and 9 deletions.
  1. +1 −4 data/source/Http.php
  2. +2 −2 net/http/Service.php
  3. +3 −3 tests/cases/net/http/ServiceTest.php
View
@@ -112,17 +112,14 @@ public function __get($property) {
*/
public function __call($method, $params) {
$params += array(array(), array());
+ $string = array('method' => 'GET');
if (isset($this->_methods[$method])) {
$string = $this->_methods[$method];
- } else {
- $string = array('method' => 'GET');
}
-
if (!isset($string['path'])) {
$string['path'] = '/' . $method;
}
-
$conn =& $this->connection;
$filter = function($self, $params) use (&$conn, $string) {
list($query, $options) = $params;
View
@@ -124,7 +124,7 @@ public function __call($method, $params = array()) {
* @return string
*/
public function head($path = null, $data = array(), array $options = array()) {
- $defaults = array('return' => 'headers', 'type' => 'html');
+ $defaults = array('return' => 'headers', 'type' => false);
return $this->send(__FUNCTION__, $path, $data, $options + $defaults);
}
@@ -137,7 +137,7 @@ public function head($path = null, $data = array(), array $options = array()) {
* @return string
*/
public function get($path = null, $data = array(), array $options = array()) {
- $defaults = array('type' => 'html');
+ $defaults = array('type' => false);
return $this->send(__FUNCTION__, $path, $data, $options + $defaults);
}
@@ -84,7 +84,7 @@ public function testHead() {
$this->assertEqual('HTTP/1.1', $http->last->response->protocol);
$this->assertEqual('200', $http->last->response->status['code']);
$this->assertEqual('OK', $http->last->response->status['message']);
- $this->assertEqual('html', $http->last->response->type());
+ $this->assertEqual(null, $http->last->response->type());
$this->assertEqual('UTF-8', $http->last->response->encoding);
$this->assertEqual('', $http->last->response->body());
}
@@ -109,7 +109,7 @@ public function testGet() {
$this->assertEqual('HTTP/1.1', $http->last->response->protocol);
$this->assertEqual('200', $http->last->response->status['code']);
$this->assertEqual('OK', $http->last->response->status['message']);
- $this->assertEqual('html', $http->last->response->type());
+ $this->assertEqual(null, $http->last->response->type());
$this->assertEqual('UTF-8', $http->last->response->encoding);
}
@@ -119,7 +119,7 @@ public function testGetPath() {
$this->assertEqual('HTTP/1.1', $http->last->response->protocol);
$this->assertEqual('200', $http->last->response->status['code']);
$this->assertEqual('OK', $http->last->response->status['message']);
- $this->assertEqual('html', $http->last->response->type());
+ $this->assertEqual(null, $http->last->response->type());
$this->assertEqual('UTF-8', $http->last->response->encoding);
}

0 comments on commit 13a1e45

Please sign in to comment.