forked from rackspace/php-opencloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurlRequestTest.php
More file actions
72 lines (70 loc) · 1.82 KB
/
CurlRequestTest.php
File metadata and controls
72 lines (70 loc) · 1.82 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* Unit Tests
*
* @copyright 2012-2013 Rackspace Hosting, Inc.
* See COPYING for licensing information
*
* @version 1.0.0
* @author Glen Campbell <glen.campbell@rackspace.com>
*/
require_once('http.inc');
class CurlRequestTest extends PHPUnit_Framework_TestCase
{
private
$http;
public function __construct() {
$this->http = new OpenCloud\CurlRequest('php://memory');
}
/**
* Tests
*/
public function test__construct() {
$this->assertEquals(TRUE,TRUE);
}
public function testSetOption() {
$this->http->SetOption(CURLOPT_RETURNTRANSFER, TRUE);
$this->assertEquals(TRUE, TRUE);
}
public function testSetConnectTimeout() {
$this->http->SetConnectTimeout(99);
$this->assertEquals(TRUE, TRUE);
}
public function testSetHttpTimeout() {
$this->http->SetHttpTimeout(99);
$this->assertEquals(TRUE, TRUE);
}
public function testSetRetries() {
$this->http->SetRetries(99);
$this->assertEquals(TRUE, TRUE);
}
public function testsetheaders() {
$this->http->SetHeaders(array('X-Status','Dumb'));
$this->assertEquals(TRUE, TRUE);
}
public function testSetHeader() {
$this->http->SetHeader('X-Status', 'Ok');
$this->assertEquals(TRUE, TRUE);
}
/**
* @expectedException OpenCloud\HttpError
*/
public function testExecute() {
$obj = $this->http->Execute();
$this->assertEquals('Foo', get_class($obj));
}
public function testinfo() {
$this->assertEquals(TRUE, is_array($this->http->info()));
}
public function testerrno() {
$this->assertEquals(0, $this->http->errno());
}
public function testerror() {
$this->assertEquals(
'',
$this->http->error());
}
public function testclose() {
$this->assertEquals(NULL, $this->http->close());
}
}