]>
Commit | Line | Data |
---|---|---|
ef591e7e GV |
1 | <?php |
2 | /** | |
51753e40 | 3 | * Unpares UrlUtils's tests |
ef591e7e GV |
4 | */ |
5 | ||
51753e40 V |
6 | namespace Shaarli\Http; |
7 | ||
8 | require_once 'application/http/UrlUtils.php'; | |
ef591e7e GV |
9 | |
10 | /** | |
11 | * Unitary tests for unparse_url() | |
12 | */ | |
51753e40 | 13 | class UnparseUrlTest extends \PHPUnit\Framework\TestCase |
ef591e7e GV |
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 | } |