Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (24 sloc) 713 Bytes
<?php
require_once('httplib.php');
require_once('PHPUnit/Framework.php');
class HTTPTestCase extends PHPUnit_Framework_TestCase
{
public function testGoogleStatusCode()
{
$params = array(
'q' => 'hi',
);
$http = new HTTPConnection('www.google.com');
$http->request('GET', '/', $params);
$response = $http->getresponse();
$this->assertEquals($response->status, 200);
}
public function testUnknownServer()
{
$this->setExpectedException('UnknownServerError');
$http = new HTTPConnection('ishouldexist.invaliddomain.c');
$http->request('GET', '/', array());
$response = $http->getresponse();
}
}
?>