/** * Tests if CTools plugin types are available as services. */ public function testCToolsPluginTypes() { foreach (ctools_plugin_get_plugin_type_info() as $module_name => $plugins) { if ($module_name != 'service_container_test_ctools') { continue; } foreach ($plugins as $plugin_type => $plugin_data) { $services = array(); $services[$module_name . '.' . $plugin_type] = TRUE; $services[$module_name . '.' . Container::underscore($plugin_type)] = TRUE; foreach ($services as $service => $value) { $this->assertTrue($this->container->has($service), "Container has plugin manager {$service} for {$module_name} / {$plugin_type}."); } } } }
/** * Load information about plugins * * This is merely a wrapper around ctools_plugin_get_plugin_type_info(), with * the added benefit of loading the required ctools file for us. * * @param bool $flush * If TRUE, flush the ctools plugin cache */ public function getPluginInfo($flush = FALSE) { ctools_include('plugins'); $this->plugin_types = ctools_plugin_get_plugin_type_info($flush); }
/** * Return the full list of plugin type info for all plugin types registered in * the current system. * * This function manages its own cache getting/setting, and should always be * used as the way to initially populate the list of plugin types. Make sure you * call this function to properly populate the ctools_plugin_type_info static * variable. * * @return array * A multilevel array of plugin type info, the outer array keyed on module * name and each inner array keyed on plugin type name. */ public function cToolsGetTypes() { ctools_include('plugins'); return ctools_plugin_get_plugin_type_info(); }