UrlTest: Test whether getAbsoluteUrl returns the given username and password

refs 
This commit is contained in:
Jennifer Mourek 2016-10-17 14:46:58 +02:00
parent 2439460371
commit d0b93b064c
1 changed files with 9 additions and 0 deletions
test/php/library/Icinga/Web

View File

@ -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')