You are here

protected function CtoolsPluginsGetInfoTestCase::assertPluginFunction in Chaos Tool Suite (ctools) 7

Assert helper to check that a specific plugin function exists.

Parameters

$module: The module that owns the plugin.

$type: The type of plugin.

$id: The id of the specific plugin to load.

$function: The identifier of the function. For example, 'settings form'.

1 call to CtoolsPluginsGetInfoTestCase::assertPluginFunction()
CtoolsPluginsGetInfoTestCase::testPluginLoading in tests/ctools.plugins.test
Test that plugins are loaded correctly.

File

tests/ctools.plugins.test, line 41

Class

CtoolsPluginsGetInfoTestCase
Test menu links depending on user permissions.

Code

protected function assertPluginFunction($module, $type, $id, $function = 'function') {
  $func = ctools_plugin_load_function($module, $type, $id, $function);
  $this
    ->assertTrue(function_exists($func), t('Plugin @plugin of plugin type @module:@type successfully retrieved @retrieved for @function.', array(
    '@plugin' => $id,
    '@module' => $module,
    '@type' => $type,
    '@function' => $function,
    '@retrieved' => $func,
  )));
}