aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Url/GetUrlSchemeTest.php
blob: 18b932d6f3a350c9f7191a5faf7517ffbdd02b76 (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
/**
 * Unitary tests for get_url_scheme()
 */

require_once 'application/Url.php';

class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
{
    /**
     * Get empty scheme string for empty Url
     */
    public function testGetUrlSchemeEmpty()
    {
        $this->assertEquals('', get_url_scheme(''));
    }

    /**
     * Get normal scheme of Url
     */
    public function testGetUrlScheme()
    {
        $this->assertEquals('http', get_url_scheme('http://domain.tld:3000'));
        $this->assertEquals('https', get_url_scheme('https://domain.tld:3000'));
        $this->assertEquals('http', get_url_scheme('domain.tld'));
        $this->assertEquals('ssh', get_url_scheme('ssh://domain.tld'));
        $this->assertEquals('ftp', get_url_scheme('ftp://domain.tld'));
        $this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout'));
    }
}