Skip to content

Commit

Permalink
Fixed some unfortunate post-release bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Jan 9, 2014
1 parent f9a8dfc commit 36930a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.0.1-stable (2014-01-09)
* Fixed: getBodyAsString on an empty body now works.
* Fixed: Version string

2.0.0-stable (2014-01-08)
* Removed: Request::createFromPHPRequest. This is now handled by
Sapi::getRequest.
Expand Down
2 changes: 2 additions & 0 deletions lib/Sabre/HTTP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public function getBodyAsString() {
$body = $this->getBody();
if (is_string($body)) {
return $body;
} elseif (is_null($body)) {
return '';
} else {
return stream_get_contents($body);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Sabre/HTTP/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class Version {
/**
* Full version number
*/
const VERSION = '2.0.0alpha6';
const VERSION = '2.0.1';

}
11 changes: 10 additions & 1 deletion tests/Sabre/HTTP/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function testStringBody() {
}


function testGetEmptyBody() {
function testGetEmptyBodyStream() {

$message = new MessageMock();
$body = $message->getBodyAsStream();
Expand All @@ -52,6 +52,15 @@ function testGetEmptyBody() {

}

function testGetEmptyBodyString() {

$message = new MessageMock();
$body = $message->getBodyAsString();

$this->assertEquals('', $body);

}

function testHeaders() {

$message = new MessageMock();
Expand Down

0 comments on commit 36930a4

Please sign in to comment.