[icinga-checkins] icinga.org: icingaweb2/master: UrlTest: Test whether getAbsoluteUrl returns the given username and password

git at icinga.org git at icinga.org
Thu Oct 20 09:31:14 CEST 2016


Module: icingaweb2
Branch: master
Commit: d0b93b064c72ecfc8bbffbfe12d7b8fe20f69db1
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=d0b93b064c72ecfc8bbffbfe12d7b8fe20f69db1

Author: Jennifer Mourek <jennifer.mourek at netways.de>
Date:   Mon Oct 17 14:46:58 2016 +0200

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 0481d72..e4648ba 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')



More information about the icinga-checkins mailing list