You are here

public function CtoolsUnitObjectCachePlugins::assertPluginFound in Chaos Tool Suite (ctools) 7

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.

2 calls to CtoolsUnitObjectCachePlugins::assertPluginFound()
CtoolsUnitObjectCachePlugins::testFindExportUICachePlugin in tests/object_cache_unit.test
Test to see that we can find the standard export_ui plugin.
CtoolsUnitObjectCachePlugins::testFindSimpleCachePlugin in tests/object_cache_unit.test
Test to see that we can find the standard simple plugin.

File

tests/object_cache_unit.test, line 87

Class

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

Code

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