forked from dcramer/php-httplib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.php
More file actions
25 lines (24 loc) · 713 Bytes
/
tests.php
File metadata and controls
25 lines (24 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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();
}
}
?>