You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
784 B

  1. <?php
  2. class HelpersTest extends PHPUnit_Framework_TestCase {
  3. public function testLowercaseHostname() {
  4. $url = 'http://Example.com/';
  5. $result = p3k\XRay\normalize_url($url);
  6. $this->assertEquals('http://example.com/', $result);
  7. }
  8. public function testAddsSlashToBareDomain() {
  9. $url = 'http://example.com';
  10. $result = p3k\XRay\normalize_url($url);
  11. $this->assertEquals('http://example.com/', $result);
  12. }
  13. public function testDoesNotModify() {
  14. $url = 'https://example.com/';
  15. $result = p3k\XRay\normalize_url($url);
  16. $this->assertEquals('https://example.com/', $result);
  17. }
  18. public function testURLEquality() {
  19. $url1 = 'https://example.com/';
  20. $url2 = 'https://example.com';
  21. $result = p3k\XRay\urls_are_equal($url1, $url2);
  22. }
  23. }