Permalink
Browse files

Merge branch 'master' into 2.3

Conflicts:
	lib/Cake/Network/Http/HttpResponse.php
  • Loading branch information...
2 parents 19cfe40 + a1035f7 commit 9c29fab4a4fb8869f25ddc9eff57ddaba8add934 @markstory markstory committed Jan 15, 2013
@@ -128,7 +128,7 @@ public function getHeader($name, $headers = null) {
* @return boolean
*/
public function isOk() {
- return $this->code == 200;
+ return in_array($this->code, array(200, 201, 202, 203, 204, 205, 206));
}
/**
@@ -157,12 +157,36 @@ public function testIsOk() {
$this->assertFalse($this->HttpResponse->isOk());
$this->HttpResponse->code = -1;
$this->assertFalse($this->HttpResponse->isOk());
- $this->HttpResponse->code = 201;
- $this->assertFalse($this->HttpResponse->isOk());
$this->HttpResponse->code = 'what?';
$this->assertFalse($this->HttpResponse->isOk());
$this->HttpResponse->code = 200;
$this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 201;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 202;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 203;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 204;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 205;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 206;
+ $this->assertTrue($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 207;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 208;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 209;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 210;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 226;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 288;
+ $this->assertFalse($this->HttpResponse->isOk());
+ $this->HttpResponse->code = 301;
+ $this->assertFalse($this->HttpResponse->isOk());
}
/**
@@ -175,7 +175,7 @@ protected function _setupTable($fixture, $db = null, $drop = true) {
return;
}
- $sources = $db->listSources();
+ $sources = (array)$db->listSources();
$table = $db->config['prefix'] . $fixture->table;
$exists = in_array($table, $sources);

0 comments on commit 9c29fab

Please sign in to comment.