Révision 7e72b748
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/ctools/tests/ctools_export_test/ctools_export.test | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
/** |
4 |
* @file |
|
5 | 4 |
* Tests for the CTools export system. |
6 | 5 |
*/ |
7 |
|
|
8 |
/** |
|
9 |
* Tests export CRUD. |
|
10 |
*/ |
|
11 | 6 |
class CtoolsExportCrudTestCase extends DrupalWebTestCase { |
12 | 7 |
|
8 |
/** |
|
9 |
* {@inheritDoc} |
|
10 |
*/ |
|
13 | 11 |
public static function getInfo() { |
14 | 12 |
return array( |
15 |
'name' => 'CTools export CRUD tests',
|
|
13 |
'name' => 'Export CRUD',
|
|
16 | 14 |
'description' => 'Test the CRUD functionality for the ctools export system.', |
17 | 15 |
'group' => 'ctools', |
18 | 16 |
); |
19 | 17 |
} |
20 | 18 |
|
21 |
protected function setUp() { |
|
22 |
parent::setUp('ctools_export_test'); |
|
23 |
$this->resetAll(); |
|
19 |
/** |
|
20 |
* {@inheritDoc} |
|
21 |
*/ |
|
22 |
function setUp(array $modules = array()) { |
|
23 |
$modules[] = 'ctools'; |
|
24 |
$modules[] = 'ctools_export_test'; |
|
25 |
parent::setUp($modules); |
|
24 | 26 |
} |
25 | 27 |
|
26 | 28 |
/** |
... | ... | |
135 | 137 |
// Check the exportable is now in_code_only. |
136 | 138 |
$this->assertTrue($default_export->in_code_only, 'The loaded exportable is in the database only.'); |
137 | 139 |
|
138 |
// Make sure the default object loaded matches the same overridden one in the database. |
|
140 |
// Make sure the default object loaded matches the same overridden one in |
|
141 |
// the database. |
|
139 | 142 |
$this->assertEqual($original_export->machine, $default_export->machine, 'The default exportable has been loaded and matches the overridden exportable.'); |
140 | 143 |
} |
141 | 144 |
|
... | ... | |
158 | 161 |
|
159 | 162 |
$machine = $database_export->machine; |
160 | 163 |
ctools_export_crud_delete('ctools_export_test', $database_export); |
164 |
|
|
161 | 165 |
// Clear the exportable caches as it's been loaded above. |
162 | 166 |
ctools_export_load_object_reset('ctools_export_test'); |
163 | 167 |
$result = ctools_export_crud_load('ctools_export_test', $machine); |
Formats disponibles : Unified diff
Weekly update of contrib modules