Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/tests/object_cache_unit.test | ||
---|---|---|
6 | 6 |
class CtoolsUnitObjectCachePlugins extends DrupalWebTestCase { |
7 | 7 |
|
8 | 8 |
/** |
9 |
* {@inheritDoc}
|
|
9 |
* {@inheritdoc}
|
|
10 | 10 |
*/ |
11 | 11 |
public static function getInfo() { |
12 | 12 |
return array( |
... | ... | |
18 | 18 |
} |
19 | 19 |
|
20 | 20 |
/** |
21 |
* {@inheritDoc}
|
|
21 |
* {@inheritdoc}
|
|
22 | 22 |
*/ |
23 |
function setUp(array $modules = array()) { |
|
23 |
public function setUp(array $modules = array()) {
|
|
24 | 24 |
$modules[] = 'ctools'; |
25 | 25 |
parent::setUp($modules); |
26 | 26 |
} |
... | ... | |
34 | 34 |
* Prefix of the assertion message. |
35 | 35 |
*/ |
36 | 36 |
public function assertValidCachePlugin($p, $msg) { |
37 |
//$this->pass(var_export($p, TRUE)); |
|
38 | 37 |
$this->assertTrue(is_array($p), $msg . ': plugin is an array'); |
39 | 38 |
|
40 | 39 |
$this->assertEqual($p['plugin type'], 'cache', $msg . ': type is cache'); |
... | ... | |
53 | 52 |
// solved. |
54 | 53 |
// $this->assertTrue(array_key_exists('cache clear', $p), $msg . ': has a clear function'); |
55 | 54 |
// $this->assertTrue(is_callable($p['cache clear']), $msg . ': clear is executable'); |
56 |
|
|
57 | 55 |
// @todo Break is optional acc'd to spec but does anything implement it? |
58 | 56 |
$this->assertTrue(!array_key_exists('cache break', $p) || is_callable($p['cache break']), $msg . ': break is executable'); |
59 | 57 |
|
... | ... | |
64 | 62 |
/** |
65 | 63 |
* Check the return value of the ctools_cache_find_plugin function. |
66 | 64 |
* |
67 |
* @param mixed $p the value to check. |
|
68 |
* @param string $msg prefix of the assertion message. |
|
65 |
* @param mixed $p |
|
66 |
* The value to check. |
|
67 |
* @param string $msg |
|
68 |
* Prefix of the assertion message. |
|
69 | 69 |
*/ |
70 | 70 |
public function assertPluginNotFound($p, $msg) { |
71 |
//$this->pass(var_export($p, TRUE)); |
|
72 | 71 |
$this->assertTrue(is_array($p), $msg . ': is an array'); |
73 | 72 |
$plugin = array_shift($p); |
74 | 73 |
$this->assertNull($plugin, $msg . ': no plugin info'); |
... | ... | |
80 | 79 |
/** |
81 | 80 |
* Check the return value of the ctools_cache_find_plugin function. |
82 | 81 |
* |
83 |
* @param mixed $p the value to check. |
|
84 |
* @param string $msg prefix of the assertion message. |
|
82 |
* @param mixed $p |
|
83 |
* The value to check. |
|
84 |
* @param string $msg |
|
85 |
* Prefix of the assertion message. |
|
85 | 86 |
*/ |
86 | 87 |
public function assertPluginFound($p, $msg) { |
87 |
//$this->pass(var_export($p, TRUE)); |
|
88 | 88 |
$this->assertTrue(is_array($p), $msg . ': is an array'); |
89 | 89 |
$plugin = array_shift($p); |
90 | 90 |
$this->assertTrue(is_array($plugin), $msg . ': has plugin data'); |
Formats disponibles : Unified diff
Weekly update of contrib modules