diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:30:33 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:30:33 +0200 |
commit | 1b8ed48a0d3964186f4d66d443783f4d250e7147 (patch) | |
tree | 23597f312507ba0c1b461755b9aa086106374a4d /tests/http/UrlUtils/UnparseUrlTest.php | |
parent | 1aa24ed8d2974cda98733f74b36844b02942cc11 (diff) | |
parent | ed3365325d231e044dedc32608fde87b1b39fa34 (diff) | |
download | Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.tar.gz Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.tar.zst Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.zip |
Merge tag 'v0.11.0' into latest
Release v0.11.0
Diffstat (limited to 'tests/http/UrlUtils/UnparseUrlTest.php')
-rw-r--r-- | tests/http/UrlUtils/UnparseUrlTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/http/UrlUtils/UnparseUrlTest.php b/tests/http/UrlUtils/UnparseUrlTest.php new file mode 100644 index 00000000..040d8c54 --- /dev/null +++ b/tests/http/UrlUtils/UnparseUrlTest.php | |||
@@ -0,0 +1,32 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * Unpares UrlUtils's tests | ||
4 | */ | ||
5 | |||
6 | namespace Shaarli\Http; | ||
7 | |||
8 | require_once 'application/http/UrlUtils.php'; | ||
9 | |||
10 | /** | ||
11 | * Unitary tests for unparse_url() | ||
12 | */ | ||
13 | class UnparseUrlTest extends \PHPUnit\Framework\TestCase | ||
14 | { | ||
15 | /** | ||
16 | * Thanks for building nothing | ||
17 | */ | ||
18 | public function testUnparseEmptyArray() | ||
19 | { | ||
20 | $this->assertEquals('', unparse_url(array())); | ||
21 | } | ||
22 | |||
23 | /** | ||
24 | * Rebuild a full-featured URL | ||
25 | */ | ||
26 | public function testUnparseFull() | ||
27 | { | ||
28 | $ref = 'http://username:password@hostname:9090/path' | ||
29 | .'?arg1=value1&arg2=value2#anchor'; | ||
30 | $this->assertEquals($ref, unparse_url(parse_url($ref))); | ||
31 | } | ||
32 | } | ||