Skip to content
Browse files

try/catch, not isError

  • Loading branch information...
1 parent 7cb1bcd commit de4b0f3fc7da7ec8a20553cb5a1b5d69ab4232ae @CloCkWeRX CloCkWeRX committed Jan 11, 2012
Showing with 14 additions and 2 deletions.
  1. +14 −2 tests/HTTP_Download2Test.php
View
16 tests/HTTP_Download2Test.php
@@ -61,7 +61,13 @@ function testsetGzip()
$this->assertTrue($h->gzip, '$h->gzip');
} else {
- $this->assertTrue(PEAR::isError($h->setGzip(true)), '$h->setGzip(true) with ext/zlib');
+ try {
+ $h->setGzip(true);// '$h->setGzip(true) with ext/zlib');
+
+ $this->fail("Expected a HTTP_Download2_Exception");
+ } catch (HTTP_Download2_Exception $e) {
+ }
+
$this->assertFalse($h->gzip, '$h->gzip');
}
unset($h);
@@ -72,7 +78,13 @@ function testsetContentType()
$h = new HTTP_Download2;
$h->setContentType('text/html;charset=iso-8859-1');
- $this->assertTrue(PEAR::isError($h->setContentType('##++***!§§§§?°°^^}][{')), '$h->setContentType("some weird characters")');
+ try {
+ $h->setContentType('##++***!§§§§?°°^^}][{'); //, '$h->setContentType("some weird characters")');
+
+ $this->fail("Expected a HTTP_Download2_Exception");
+ } catch (HTTP_Download2_Exception $e) {
+ }
+
$this->assertEquals('text/html;charset=iso-8859-1', $h->headers['Content-Type'], '$h->headers["Content-Type"] == "text/html;charset=iso-8859-1"');
unset($h);
}

0 comments on commit de4b0f3

Please sign in to comment.
Something went wrong with that request. Please try again.