Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/tests/ctools_export_test/ctools_export.test | ||
---|---|---|
6 | 6 |
class CtoolsExportCrudTestCase extends DrupalWebTestCase { |
7 | 7 |
|
8 | 8 |
/** |
9 |
* {@inheritDoc}
|
|
9 |
* {@inheritdoc}
|
|
10 | 10 |
*/ |
11 | 11 |
public static function getInfo() { |
12 | 12 |
return array( |
... | ... | |
17 | 17 |
} |
18 | 18 |
|
19 | 19 |
/** |
20 |
* {@inheritDoc}
|
|
20 |
* {@inheritdoc}
|
|
21 | 21 |
*/ |
22 |
function setUp(array $modules = array()) { |
|
22 |
public function setUp(array $modules = array()) {
|
|
23 | 23 |
$modules[] = 'ctools'; |
24 | 24 |
$modules[] = 'ctools_export_test'; |
25 | 25 |
parent::setUp($modules); |
... | ... | |
28 | 28 |
/** |
29 | 29 |
* Tests CRUD operation: Load. |
30 | 30 |
*/ |
31 |
function testCrudExportLoad() { |
|
31 |
public function testCrudExportLoad() {
|
|
32 | 32 |
$loaded_export = ctools_export_crud_load('ctools_export_test', 'database_test'); |
33 | 33 |
|
34 | 34 |
$expected_export = new stdClass(); |
... | ... | |
49 | 49 |
/** |
50 | 50 |
* Tests CRUD operation: Load multiple. |
51 | 51 |
*/ |
52 |
function testCrudExportLoadMultiple() { |
|
52 |
public function testCrudExportLoadMultiple() {
|
|
53 | 53 |
$exportable_names = array('database_test', 'overridden_test', 'default_test'); |
54 | 54 |
$loaded_exports = ctools_export_crud_load_multiple('ctools_export_test', $exportable_names); |
55 | 55 |
|
... | ... | |
59 | 59 |
/** |
60 | 60 |
* Tests CRUD operation: Load all. |
61 | 61 |
*/ |
62 |
function testCrudExportLoadAll() { |
|
62 |
public function testCrudExportLoadAll() {
|
|
63 | 63 |
$loaded_exports = ctools_export_crud_load_all('ctools_export_test'); |
64 | 64 |
|
65 | 65 |
$this->assertEqual(count($loaded_exports), 3, 'All exportables have been loaded.'); |
... | ... | |
68 | 68 |
/** |
69 | 69 |
* Tests CRUD operation: Save. |
70 | 70 |
*/ |
71 |
function testCrudExportSave() { |
|
71 |
public function testCrudExportSave() {
|
|
72 | 72 |
$default_export = ctools_export_crud_load('ctools_export_test', 'default_test'); |
73 | 73 |
|
74 |
$this->assertTrue($default_export->in_code_only,'The loaded exportable is in code only.'); |
|
74 |
$this->assertTrue($default_export->in_code_only, 'The loaded exportable is in code only.');
|
|
75 | 75 |
|
76 | 76 |
ctools_export_crud_save('ctools_export_test', $default_export); |
77 | 77 |
|
... | ... | |
86 | 86 |
/** |
87 | 87 |
* Tests CRUD operation: New. |
88 | 88 |
*/ |
89 |
function testCrudExportNew() { |
|
89 |
public function testCrudExportNew() {
|
|
90 | 90 |
// Default exportable with defualt values. |
91 | 91 |
$new_export = ctools_export_crud_new('ctools_export_test'); |
92 | 92 |
|
... | ... | |
115 | 115 |
/** |
116 | 116 |
* Tests CRUD operation: Revert. |
117 | 117 |
*/ |
118 |
function testCrudExportRevert() { |
|
118 |
public function testCrudExportRevert() {
|
|
119 | 119 |
// Load exportable, will come from database. |
120 | 120 |
$original_export = ctools_export_crud_load('ctools_export_test', 'overridden_test'); |
121 | 121 |
|
... | ... | |
145 | 145 |
/** |
146 | 146 |
* Tests CRUD operation: Delete. |
147 | 147 |
*/ |
148 |
function testCrudExportDelete() { |
|
148 |
public function testCrudExportDelete() {
|
|
149 | 149 |
// Create a stub entry save it and delete it from the database. |
150 | 150 |
$new_export = ctools_export_crud_new('ctools_export_test'); |
151 | 151 |
ctools_export_crud_save('ctools_export_test', $new_export); |
... | ... | |
172 | 172 |
/** |
173 | 173 |
* Tests CRUD operation: Set status. |
174 | 174 |
*/ |
175 |
function testCrudExportSetStatus() { |
|
175 |
public function testCrudExportSetStatus() {
|
|
176 | 176 |
// Database only object. |
177 | 177 |
$database_export = ctools_export_crud_load('ctools_export_test', 'database_test'); |
178 | 178 |
ctools_export_crud_disable('ctools_export_test', $database_export); |
Formats disponibles : Unified diff
Weekly update of contrib modules