GetUrlSchemeTest.php 891 B

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