forked from rackspace/php-opencloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVolumeTypeTest.php
More file actions
58 lines (56 loc) · 1.34 KB
/
VolumeTypeTest.php
File metadata and controls
58 lines (56 loc) · 1.34 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
<?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('volumetype.inc');
require_once('stub_conn.inc');
require_once('volumeservice.inc');
class VolumeTypeTest extends PHPUnit_Framework_TestCase
{
private
$vt;
public function __construct() {
$conn = new StubConnection('http://example.com', 'SECRET');
$serv = new OpenCloud\VolumeService(
$conn, 'cloudBlockStorage', 'DFW', 'publicURL'
);
$this->vt = new OpenCloud\VolumeService\VolumeType($serv);
}
/**
* Tests
*/
/**
* @expectedException OpenCloud\CreateError
*/
public function testCreate() {
$this->vt->Create();
}
/**
* @expectedException OpenCloud\UpdateError
*/
public function testUpdate() {
$this->vt->Update();
}
/**
* @expectedException OpenCloud\DeleteError
*/
public function testDelete() {
$this->vt->Delete();
}
public function testJsonName() {
$this->assertEquals(
'volume_type',
$this->vt->JsonName());
}
public function testResourceName() {
$this->assertEquals(
'types',
$this->vt->ResourceName());
}
}