You are here

public function CtoolsPluginsGetInfoTestCase::testPluginLoading in Chaos Tool Suite (ctools) 7

Test that plugins are loaded correctly.

File

tests/ctools.plugins.test, line 122

Class

CtoolsPluginsGetInfoTestCase
Test menu links depending on user permissions.

Code

public function testPluginLoading() {
  ctools_include('plugins');
  $module = 'ctools_plugin_test';
  $type = 'not_cached';

  // Test function retrieval for plugins using different definition methods.
  $this
    ->assertPluginFunction($module, $type, 'plugin_array', 'function');
  $this
    ->assertPluginFunction($module, $type, 'plugin_array2', 'function');
  $this
    ->assertPluginMissingFunction($module, $type, 'plugin_array_dne', 'function');
  $this
    ->assertPluginFunction($module, "big_hook_{$type}", 'test1', 'function');

  // Test class retrieval for plugins using different definition methods.
  $this
    ->assertPluginClass($module, $type, 'plugin_array', 'handler');
  $this
    ->assertPluginClass($module, $type, 'plugin_array2', 'handler');
  $this
    ->assertPluginMissingClass($module, $type, 'plugin_array_dne', 'handler');

  // @todo Test big hook plugins.
  $type = 'cached';

  // Test function retrieval for plugins using different definition methods.
  $this
    ->assertPluginFunction($module, $type, 'plugin_array', 'function');
  $this
    ->assertPluginFunction($module, $type, 'plugin_array2', 'function');
  $this
    ->assertPluginMissingFunction($module, $type, 'plugin_array_dne', 'function');
  $this
    ->assertPluginFunction($module, "big_hook_{$type}", 'test1', 'function');

  // Test class retrieval for plugins using different definition methods.
  $this
    ->assertPluginClass($module, $type, 'plugin_array', 'handler');
  $this
    ->assertPluginClass($module, $type, 'plugin_array2', 'handler');
  $this
    ->assertPluginMissingClass($module, $type, 'plugin_array_dne', 'handler');

  // @todo Test big hook plugins.
}