3 * Unitary tests for get_url_scheme()
6 namespace Shaarli\Http
;
8 require_once 'application/http/UrlUtils.php';
10 class GetUrlSchemeTest
extends \PHPUnit\Framework\TestCase
13 * Get empty scheme string for empty UrlUtils
15 public function testGetUrlSchemeEmpty()
17 $this->assertEquals('', get_url_scheme(''));
21 * Get normal scheme of UrlUtils
23 public function testGetUrlScheme()
25 $this->assertEquals('http', get_url_scheme('http://domain.tld:3000'));
26 $this->assertEquals('https', get_url_scheme('https://domain.tld:3000'));
27 $this->assertEquals('http', get_url_scheme('domain.tld'));
28 $this->assertEquals('ssh', get_url_scheme('ssh://domain.tld'));
29 $this->assertEquals('ftp', get_url_scheme('ftp://domain.tld'));
30 $this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout'));