diff --git a/src/Message/Message.php b/src/Message/Message.php index f26ad9d..753dcd1 100644 --- a/src/Message/Message.php +++ b/src/Message/Message.php @@ -158,19 +158,19 @@ abstract class Message implements MessageInterface * and supply your own delimiter when concatenating. * * If the header does not appear in the message, this method MUST return - * a null value. + * an empty string. * * @param string $name Case-insensitive header field name. - * @return string|null A string of values as provided for the given header + * @return string A string of values as provided for the given header * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return a null value. + * the message, this method MUST return an empty string. */ public function getHeaderLine($name) { if (isset($this->headers[$name])) { return join(", ", $this->headers[$name]); } else { - return null; + return ""; } } diff --git a/test/tests/unit/Message/MessageTest.php b/test/tests/unit/Message/MessageTest.php index 7e94eaa..6e575d7 100644 --- a/test/tests/unit/Message/MessageTest.php +++ b/test/tests/unit/Message/MessageTest.php @@ -186,10 +186,10 @@ class MessageTest extends \PHPUnit_Framework_TestCase /** * @covers WellRESTed\Message\Message::getHeaderLine */ - public function testGetHeaderLineReturnsNullForUnsetHeader() + public function testGetHeaderLineReturnsEmptyStringForUnsetHeader() { $message = $this->getMockForAbstractClass('\WellRESTed\Message\Message'); - $this->assertNull($message->getHeaderLine("X-not-set")); + $this->assertSame("", $message->getHeaderLine("X-not-set")); } /**