diff options
author | Aurélien Tamisier <virtualtam+github@flibidi.net> | 2019-01-18 21:26:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 21:26:03 +0100 |
commit | ff3b5dc5542ec150f0d9b447394364a15e9156d0 (patch) | |
tree | 5e926e36816d510e3b3a10e20b94c23f43b55092 /tests/http/UrlUtils/GetUrlSchemeTest.php | |
parent | 1826e383ecf501302974132fd443cf1ca06e10f6 (diff) | |
parent | dea72c711ff740b3b829d238fcf85648465143a0 (diff) | |
download | Shaarli-ff3b5dc5542ec150f0d9b447394364a15e9156d0.tar.gz Shaarli-ff3b5dc5542ec150f0d9b447394364a15e9156d0.tar.zst Shaarli-ff3b5dc5542ec150f0d9b447394364a15e9156d0.zip |
Merge pull request #1248 from virtualtam/refactor/namespacing
Ensure all PHP classes are properly namespaced
Diffstat (limited to 'tests/http/UrlUtils/GetUrlSchemeTest.php')
-rw-r--r-- | tests/http/UrlUtils/GetUrlSchemeTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/http/UrlUtils/GetUrlSchemeTest.php b/tests/http/UrlUtils/GetUrlSchemeTest.php new file mode 100644 index 00000000..2b97f7be --- /dev/null +++ b/tests/http/UrlUtils/GetUrlSchemeTest.php | |||
@@ -0,0 +1,32 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * Unitary tests for get_url_scheme() | ||
4 | */ | ||
5 | |||
6 | namespace Shaarli\Http; | ||
7 | |||
8 | require_once 'application/http/UrlUtils.php'; | ||
9 | |||
10 | class GetUrlSchemeTest extends \PHPUnit\Framework\TestCase | ||
11 | { | ||
12 | /** | ||
13 | * Get empty scheme string for empty UrlUtils | ||
14 | */ | ||
15 | public function testGetUrlSchemeEmpty() | ||
16 | { | ||
17 | $this->assertEquals('', get_url_scheme('')); | ||
18 | } | ||
19 | |||
20 | /** | ||
21 | * Get normal scheme of UrlUtils | ||
22 | */ | ||
23 | public function testGetUrlScheme() | ||
24 | { | ||
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')); | ||
31 | } | ||
32 | } | ||