function CtoolsUnitObjectCachePlugins::assertPluginNotFound

Check the return value of the ctools_cache_find_plugin function.

Parameters

mixed $p: The value to check.

string $msg: Prefix of the assertion message.

1 call to CtoolsUnitObjectCachePlugins::assertPluginNotFound()
CtoolsUnitObjectCachePlugins::testFindFoobarbazCachePlugin in tests/object_cache_unit.test
Test to see that we don't find plugins that aren't there.

File

tests/object_cache_unit.test, line 70

Class

CtoolsUnitObjectCachePlugins
Test ctools_cache_find_plugin and the structure of the default cache plugins.

Code

public function assertPluginNotFound($p, $msg) {
    $this->assertTrue(is_array($p), $msg . ': is an array');
    $plugin = array_shift($p);
    $this->assertNull($plugin, $msg . ': no plugin info');
    $data = array_shift($p);
    $this->assertTrue(empty($data) || is_string($data), $msg . ': data string-like');
    $this->assertTrue(empty($p), $msg . ': just two elements');
}