1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Test the UUID handling when the UUID module is present.
|
5
|
*/
|
6
|
class CtoolsUUIDWithUUID extends DrupalWebTestCase {
|
7
|
|
8
|
/**
|
9
|
* {@inheritDoc}
|
10
|
*/
|
11
|
public static function getInfo() {
|
12
|
return array(
|
13
|
'name' => 'UUID handing, with UUID module',
|
14
|
'description' => 'Check that the CTools UUID functions behave correctly when the UUID module is installed.',
|
15
|
'group' => 'ctools',
|
16
|
'dependencies' => array('ctools'),
|
17
|
// 'dependencies' => array('ctools', 'uuid'),
|
18
|
);
|
19
|
}
|
20
|
|
21
|
/**
|
22
|
* {@inheritDoc}
|
23
|
*/
|
24
|
function setUp(array $modules = array()) {
|
25
|
$modules[] = 'ctools';
|
26
|
// @todo Add UUID as a test dependency and then add comment out this line.
|
27
|
// $modules[] = 'uuid';
|
28
|
parent::setUp($modules);
|
29
|
}
|
30
|
|
31
|
/**
|
32
|
* Check we can get a UUID.
|
33
|
*
|
34
|
* NB: This test will use one (and only one) of the mechanisms available
|
35
|
* from pear,
|
36
|
*
|
37
|
* @todo Fix this so testbot doesn't fail.
|
38
|
*/
|
39
|
public function DISABLED_testMakeNewUUID() {
|
40
|
// drupal_get_filename will report even if the module is disabled.
|
41
|
if (drupal_get_filename('module', 'uuid') && !module_exists('uuid')) {
|
42
|
module_enable(array('uuid'));
|
43
|
}
|
44
|
// if we now have uuid module, use it.
|
45
|
if (module_exists('uuid')) {
|
46
|
$uuid = ctools_uuid_generate();
|
47
|
$this->assertTrue(ctools_uuid_is_valid($uuid), 'UUID generated (uuid): ' . $uuid);
|
48
|
}
|
49
|
else {
|
50
|
// otherwise say we can't...
|
51
|
$this->verbose('uuid module not present');
|
52
|
}
|
53
|
}
|
54
|
|
55
|
}
|