You are here

function SkinrApiTestCase::testSkinrInvokeAll in Skinr 7.2

Test that module_invoke_all() can load a hook defined in hook_hook_info().

File

tests/skinr.test, line 335
Tests for the Skinr module.

Class

SkinrApiTestCase
Tests API functionality.

Code

function testSkinrInvokeAll() {

  // Ensure functions from $module.skinr.inc in both module root and in
  // custom paths are triggered.
  $config_info = skinr_invoke_all('skinr_config_info');
  $this
    ->verbose(highlight_string('<?php ' . var_export($config_info, TRUE), TRUE));
  $this
    ->assertTrue(in_array('system', $config_info), 'Function triggered in $module.skinr.inc file auto-loaded by module_hook().');
  $this
    ->assertTrue(in_array('node', $config_info), 'Function triggered in $module.skinr.inc file in custom path.');

  // Ensure that skinr_test_incompatible is not included.
  $this
    ->assertTrue(!in_array('skinr_test_incompatible', $config_info), 'Function in incompatible module not triggered.');
}