public function testPathToUrl() { $_SERVER['HTTP_HOST'] = 'test.dev'; $_SERVER['SERVER_PORT'] = 80; $_SERVER['REQUEST_URI'] = '/test.php?foo=bar'; $_SERVER['QUERY_STRING'] = 'foo=bar'; $_SERVER['PHP_SELF'] = '/test.php'; $_SERVER['DOCUMENT_ROOT'] = PROJECT_ROOT; isSame('tests/UrlTest.php', Url::pathToRel(__FILE__)); isSame('http://test.dev/tests/UrlTest.php', Url::pathToUrl(__FILE__)); $_SERVER['DOCUMENT_ROOT'] = str_replace('/', '\\', PROJECT_ROOT); isSame('tests/UrlTest.php', Url::pathToRel(__FILE__)); isSame('http://test.dev/tests/UrlTest.php', Url::pathToUrl(__FILE__)); }