]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - tests/Url/GetUrlSchemeTest.php
lint: apply phpcbf to tests/
[github/shaarli/Shaarli.git] / tests / Url / GetUrlSchemeTest.php
CommitLineData
ef591e7e
GV
1<?php
2/**
3 * Unitary tests for get_url_scheme()
4 */
5
6require_once 'application/Url.php';
7
8class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
9{
10 /**
11 * Get empty scheme string for empty Url
12 */
13 public function testGetUrlSchemeEmpty()
14 {
15 $this->assertEquals('', get_url_scheme(''));
16 }
17
18 /**
19 * Get normal scheme of Url
20 */
21 public function testGetUrlScheme()
22 {
23 $this->assertEquals('http', get_url_scheme('http://domain.tld:3000'));
24 $this->assertEquals('https', get_url_scheme('https://domain.tld:3000'));
25 $this->assertEquals('http', get_url_scheme('domain.tld'));
26 $this->assertEquals('ssh', get_url_scheme('ssh://domain.tld'));
27 $this->assertEquals('ftp', get_url_scheme('ftp://domain.tld'));
28 $this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout'));
29 }
30}