From d0b93b064c72ecfc8bbffbfe12d7b8fe20f69db1 Mon Sep 17 00:00:00 2001 From: Jennifer Mourek Date: Mon, 17 Oct 2016 14:46:58 +0200 Subject: [PATCH] UrlTest: Test whether getAbsoluteUrl returns the given username and password refs #12133 --- test/php/library/Icinga/Web/UrlTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/php/library/Icinga/Web/UrlTest.php b/test/php/library/Icinga/Web/UrlTest.php index 0481d723b..e4648ba0d 100644 --- a/test/php/library/Icinga/Web/UrlTest.php +++ b/test/php/library/Icinga/Web/UrlTest.php @@ -9,6 +9,15 @@ use Icinga\Test\BaseTestCase; class UrlTest extends BaseTestCase { + public function testWhetherGetAbsoluteUrlReturnsTestUrl(){ + $url = Url::fromPath('http://testusername:testpassword@testsite.com/path/to/my/url.html'); + $this->assertEquals( + 'http://testusername:testpassword@testsite.com/path/to/my/url.html', + $url->getAbsoluteUrl(), + 'Url::fromPath does not reassemble the correct url' + ); + } + public function testWhetherFromRequestWorksWithoutARequest() { $this->getRequestMock()->shouldReceive('getBaseUrl')->andReturn('/path/to')