X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fut_HttpMessage.phpt;h=dd3668027270952656991b8eb6c3b7233b773cea;hb=dbc4ec02cd319000b5c8589910047cfe6d5738be;hp=eb693ef63e1b8906d69c279ee59db9001c48d97d;hpb=ba74942b44bb39de8a028a56524db5a3c37363d5;p=m6w6%2Fext-http diff --git a/tests/ut_HttpMessage.phpt b/tests/ut_HttpMessage.phpt index eb693ef..dd36680 100644 --- a/tests/ut_HttpMessage.phpt +++ b/tests/ut_HttpMessage.phpt @@ -11,6 +11,7 @@ skipif(!@include 'PHPUnit2/Framework/TestCase.php', 'need PHPUnit2'); echo "-TEST\n"; error_reporting(E_ALL); +ini_set('html_errors', 0); require_once 'PHPUnit2/Framework/TestSuite.php'; require_once 'PHPUnit2/Framework/TestCase.php'; @@ -127,21 +128,21 @@ class HttpMessageTest extends PHPUnit2_Framework_TestCase $this->assertEquals('POST', $this->requestMessage->getRequestMethod()); } - function test_getRequestUri() + function test_getRequestUrl() { - $this->assertFalse($this->emptyMessage->getRequestUri()); - $this->assertFalse($this->responseMessage->getRequestUri()); - $this->assertEquals('/foo', $this->requestMessage->getRequestUri()); + $this->assertFalse($this->emptyMessage->getRequestUrl()); + $this->assertFalse($this->responseMessage->getRequestUrl()); + $this->assertEquals('/foo', $this->requestMessage->getRequestUrl()); } - function test_setRequestUri() + function test_setRequestUrl() { - $this->assertFalse($this->emptyMessage->setRequestUri('/bla')); - $this->assertFalse($this->responseMessage->setRequestUri('/bla')); - $this->assertTrue($this->requestMessage->setRequestUri('/bla')); - $this->assertFalse($this->emptyMessage->getRequestUri()); - $this->assertFalse($this->responseMessage->getRequestUri()); - $this->assertEquals('/bla', $this->requestMessage->getRequestUri()); + $this->assertFalse($this->emptyMessage->setRequestUrl('/bla')); + $this->assertFalse($this->responseMessage->setRequestUrl('/bla')); + $this->assertTrue($this->requestMessage->setRequestUrl('/bla')); + $this->assertFalse($this->emptyMessage->getRequestUrl()); + $this->assertFalse($this->responseMessage->getRequestUrl()); + $this->assertEquals('/bla', $this->requestMessage->getRequestUrl()); } function test_getHttpVersion() @@ -163,9 +164,12 @@ class HttpMessageTest extends PHPUnit2_Framework_TestCase function test_getParentMessage() { - $this->assertNull($this->emptyMessage->getParentMessage()); $this->assertTrue($this->responseMessage->getParentMessage() instanceOf HttpMessage); - $this->assertNull($this->requestMessage->getParentMessage()); + try { + $this->requestMessage->getParentMessage(); + $this->assertTrue(false, "\$this->requestMessage->getParentMessage() did not throw an exception"); + } catch (HttpRuntimeException $ex) { + } } function test_send() @@ -249,17 +253,17 @@ Notice: HttpMessage::getRequestMethod(): HttpMessage is not of type HTTP_MSG_REQ Notice: HttpMessage::getRequestMethod(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::getRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::getRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::getRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::getRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::setRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::setRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::setRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::setRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::getRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::getRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d -Notice: HttpMessage::getRequestUri(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d +Notice: HttpMessage::getRequestUrl(): HttpMessage is not of type HTTP_MSG_REQUEST in %sut_HttpMessage.php on line %d Time: 0