]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - tests/http/UrlUtils/GetUrlSchemeTest.php
Merge pull request #1621 from ArthurHoaro/feature/tag-separators
[github/shaarli/Shaarli.git] / tests / http / UrlUtils / GetUrlSchemeTest.php
CommitLineData
ef591e7e
GV
1<?php
2/**
3 * Unitary tests for get_url_scheme()
4 */
5
51753e40 6namespace Shaarli\Http;
ef591e7e 7
51753e40
V
8require_once 'application/http/UrlUtils.php';
9
a5a9cf23 10class GetUrlSchemeTest extends \Shaarli\TestCase
ef591e7e
GV
11{
12 /**
51753e40 13 * Get empty scheme string for empty UrlUtils
ef591e7e
GV
14 */
15 public function testGetUrlSchemeEmpty()
16 {
17 $this->assertEquals('', get_url_scheme(''));
18 }
19
20 /**
51753e40 21 * Get normal scheme of UrlUtils
ef591e7e
GV
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}