X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fut_HttpUtil.phpt;h=6bf6e2e9177004916bc2890ba45b118f1a3b199b;hp=98a11e8e2d372fd6503b7984726982430c768dc9;hb=0e0def98a4ea4463bf8c21c6f161b2b37aa8c49d;hpb=bf87f6e654235acb023ca052a5e71faeb2635a3f diff --git a/tests/ut_HttpUtil.phpt b/tests/ut_HttpUtil.phpt index 98a11e8..6bf6e2e 100644 --- a/tests/ut_HttpUtil.phpt +++ b/tests/ut_HttpUtil.phpt @@ -27,9 +27,9 @@ class HttpUtilTest extends PHPUnit2_Framework_TestCase function test_buildUrl() { $_SERVER['SERVER_NAME'] = 'www.example.com'; - $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)); + $this->assertEquals('http://www.example.com/test.php?foo=bar', HttpUtil::buildUrl('/test.php?foo=bar', array('port' => 80))); + $this->assertEquals('https://www.example.com/', HttpUtil::buildUrl('/', array('scheme' => 'https'))); + $this->assertEquals('ftp://ftp.example.com/pub', HttpUtil::buildUrl('/pub', array('host' => 'ftp.example.com', 'port' => 21))); } function test_negotiateLanguage() @@ -100,7 +100,7 @@ class HttpUtilTest extends PHPUnit2_Framework_TestCase function test_zlib() { 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__), HTTP_DEFLATE_TYPE_GZIP))); $this->assertEquals(file_get_contents(__FILE__), http_inflate(http_deflate(file_get_contents(__FILE__)))); } else { $this->assertFalse($support);