aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Url/UnparseUrlTest.php
blob: e314b48468b789688fec09dda194074c670de0e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
 * Unpares Url's tests
 */

require_once 'application/Url.php';

/**
 * Unitary tests for unparse_url()
 */
class UnparseUrlTest extends PHPUnit_Framework_TestCase
{
    /**
     * Thanks for building nothing
     */
    public function testUnparseEmptyArray()
    {
        $this->assertEquals('', unparse_url(array()));
    }

    /**
     * Rebuild a full-featured URL
     */
    public function testUnparseFull()
    {
        $ref = 'http://username:password@hostname:9090/path'
              .'?arg1=value1&arg2=value2#anchor';
        $this->assertEquals($ref, unparse_url(parse_url($ref)));
    }
}