You are here

function SkinrApiTest::testSkinrInvokeAll in Skinr 8.2

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

File

src/Tests/SkinrApiTest.php, line 177
Contains \Drupal\skinr\Tests\SkinrApiTest.

Class

SkinrApiTest
Tests Skinr API functionality.

Namespace

Drupal\skinr\Tests

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.');
}