X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fut_HttpUtil.phpt;h=98a11e8e2d372fd6503b7984726982430c768dc9;hb=3017eb87773ddee0b170d532ff92e195f2f69612;hp=19df49aba20da97ba1b875aa06997d588fadc22e;hpb=2fc0f1875846114e57571bee1b0fa663deb1722d;p=m6w6%2Fext-http diff --git a/tests/ut_HttpUtil.phpt b/tests/ut_HttpUtil.phpt index 19df49a..98a11e8 100644 --- a/tests/ut_HttpUtil.phpt +++ b/tests/ut_HttpUtil.phpt @@ -11,6 +11,7 @@ skipif(!@include 'PHPUnit2/Framework/TestCase.php', 'need PHPUnit2'); echo "-TEST\n"; error_reporting(E_ALL); +ini_set('html_errors', 0); require_once 'PHPUnit2/Framework/TestSuite.php'; require_once 'PHPUnit2/Framework/TestCase.php'; @@ -23,12 +24,12 @@ class HttpUtilTest extends PHPUnit2_Framework_TestCase $this->assertEquals('Thu, 01 Jan 1970 00:00:01 GMT', HttpUtil::date(1)); } - function test_buildUri() + function test_buildUrl() { $_SERVER['SERVER_NAME'] = 'www.example.com'; - $this->assertEquals('http://www.example.com/test.php?foo=bar', HttpUtil::buildUri('/test.php?foo=bar', null, null, 80)); - $this->assertEquals('https://www.example.com/', HttpUtil::buildUri('/', 'https')); - $this->assertEquals('ftp://ftp.example.com/pub', HttpUtil::buildUri('/pub', null, 'ftp.example.com', 21)); + $this->assertEquals('http://www.example.com/test.php?foo=bar', HttpUtil::buildUrl('/test.php?foo=bar', null, null, 80)); + $this->assertEquals('https://www.example.com/', HttpUtil::buildUrl('/', 'https')); + $this->assertEquals('ftp://ftp.example.com/pub', HttpUtil::buildUrl('/pub', null, 'ftp.example.com', 21)); } function test_negotiateLanguage() @@ -101,7 +102,6 @@ class HttpUtilTest extends PHPUnit2_Framework_TestCase if ($support = http_support(HTTP_SUPPORT_ENCODINGS)) { $this->assertEquals(file_get_contents(__FILE__), http_gzdecode(http_gzencode(file_get_contents(__FILE__)))); $this->assertEquals(file_get_contents(__FILE__), http_inflate(http_deflate(file_get_contents(__FILE__)))); - $this->assertEquals(file_get_contents(__FILE__), http_uncompress(http_compress(file_get_contents(__FILE__)))); } else { $this->assertFalse($support); }