|
@@ 15-22 (lines=8) @@
|
| 12 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com/test', '')); |
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
public function testHttpPaths() |
| 16 |
|
{ |
| 17 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com/', '/test')); |
| 18 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com', '/test')); |
| 19 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com//', '/test')); |
| 20 |
|
$this->assertEquals('http://example.com/test/', UrlUtils::resolveRelativeUrl('http://example.com', '/test/')); |
| 21 |
|
$this->assertEquals('http://example.com/test/test', UrlUtils::resolveRelativeUrl('http://example.com/', '/test/test')); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
|
public function testHttpPathsParent() |
| 25 |
|
{ |
|
@@ 24-31 (lines=8) @@
|
| 21 |
|
$this->assertEquals('http://example.com/test/test', UrlUtils::resolveRelativeUrl('http://example.com/', '/test/test')); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
|
public function testHttpPathsParent() |
| 25 |
|
{ |
| 26 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com/parent/', '/test')); |
| 27 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com/parent', '/test')); |
| 28 |
|
$this->assertEquals('http://example.com/test', UrlUtils::resolveRelativeUrl('http://example.com//parent', '/test')); |
| 29 |
|
$this->assertEquals('http://example.com/test/', UrlUtils::resolveRelativeUrl('http://example.com/parent', '/test/')); |
| 30 |
|
$this->assertEquals('http://example.com/test/test', UrlUtils::resolveRelativeUrl('http://example.com/parent/', '/test/test')); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testHttpPathsParentRelative() |
| 34 |
|
{ |
|
@@ 42-49 (lines=8) @@
|
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
public function testHttpAnchors() |
| 43 |
|
{ |
| 44 |
|
$this->assertEquals('http://example.com/#test', UrlUtils::resolveRelativeUrl('http://example.com/', '#test')); |
| 45 |
|
$this->assertEquals('http://example.com/test#test', UrlUtils::resolveRelativeUrl('http://example.com/', 'test#test')); |
| 46 |
|
$this->assertEquals('http://example.com/test#test', UrlUtils::resolveRelativeUrl('http://example.com', 'test#test')); |
| 47 |
|
$this->assertEquals('http://example.com/test/test#test', UrlUtils::resolveRelativeUrl('http://example.com/', 'test/test#test')); |
| 48 |
|
$this->assertEquals('http://example.com/test/test#test', UrlUtils::resolveRelativeUrl('http://example.com', 'test/test#test')); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
public function testHttpQS() |
|
@@ 52-59 (lines=8) @@
|
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
public function testHttpQS() |
| 53 |
|
{ |
| 54 |
|
$this->assertEquals('http://example.com/?test=1', UrlUtils::resolveRelativeUrl('http://example.com/', '?test=1')); |
| 55 |
|
$this->assertEquals('http://example.com/test?test=1', UrlUtils::resolveRelativeUrl('http://example.com/', 'test?test=1')); |
| 56 |
|
$this->assertEquals('http://example.com/test?test=1', UrlUtils::resolveRelativeUrl('http://example.com', 'test?test=1')); |
| 57 |
|
$this->assertEquals('http://example.com/test/test?test=1', UrlUtils::resolveRelativeUrl('http://example.com/', 'test/test?test=1')); |
| 58 |
|
$this->assertEquals('http://example.com/test/test?test=1', UrlUtils::resolveRelativeUrl('http://example.com', 'test/test?test=1')); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
public function testFilePaths() |