Newer
Older
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* @file
* This is the base class of all Cloud module family.
* Basically this test case does nothing.
*
* Copyright (c) 2010-2012 DOCOMO Innovations, Inc.
*
*/
/**
* This class is the base class for some of the
* Simple Tests. This class has been simplified
* for unit tests that do not require loading of
* sub-clouds. For any tests that require sub-clouds,
* implement AwsCloudTestCase instead of this class.
*/
class CloudTestCase extends DrupalWebTestCase {
protected $privileged_user;
public static function getInfo() {
return array(
'name' => 'Cloud' ,
'description' => 'Cloud Test Cases',
'group' => 'Cloud' ,
);
}
public function setUp() {
//setup takes arguments so
//extended sub-classes can pass modules
//and have them get loaded.
$args = func_get_args();
$modules = array_merge(array(
'cloud' ,
'cloud_server_templates',
'cloud_scripting' ,
'cloud_pricing' ,
'cloud_alerts' ,
'cloud_activity_audit' ,
'cloud_cluster' ,
'aws_ec2_api' , //Found bug where scripting is making references to AWS modules. Shouldn't be the case
'aws_ec2_lib' ,
'aws'
),
$args);
call_user_func_array(array('parent', 'setUp'), $modules);
// Create and log in our privileged user.
$this->privileged_user = $this->drupalCreateUser(array(
// system module
'access administration pages' ,
'administer site configuration' ,
// Cloud module
'administer cloud' ,
'access dashboard' ,
// Activity Audit module
'access audit report' ,
// Server Template module
'copy server template' ,
'create server template' ,
'delete server template' ,
'edit server template' ,
'launch server template' ,
'list server templates' ,
'set scripts and alerts' ,
'view server template' ,
// Alerts module
'list alerts' ,
'create alert' ,
'view alerts' ,
'edit alert' ,
'delete alert' ,
// Cluster
'create cluster',
'delete cluster',
'list clusters' ,
'update cluster',
// Scripting module
'create script' ,
'list scripts' ,
'edit script' ,
'delete script' ,
// Pricing module
'create pricing',
'list pricing' ,
'edit pricing' ,
'delete pricing',
));
$this->drupalLogin($this->privileged_user);
}
public function tearDown() {
parent::tearDown();
}
}