You are here

public function SkinrApiTestCase::testSkinrConfigInfo in Skinr 7.2

Tests hook_skinr_config_info().

File

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

Class

SkinrApiTestCase
Tests API functionality.

Code

public function testSkinrConfigInfo() {

  // Verify that skinr_get_config_info() finds all existing and compatible
  // hook_skinr_config_info() implementations.
  $config = skinr_get_config_info();

  // Skinr's own implementation in skinr.skinr.inc should always be found.
  $this
    ->assertTrue(in_array('system', $config), 'hook_skinr_config_info() in $module.skinr.inc found.');
  foreach ($config as $key => $type) {
    if ($type == 'system') {
      unset($config[$key]);
    }
  }

  // Skinr's implementation on behalf of Node module in modules/node.skinr.inc
  // should be found.
  $this
    ->assertTrue(in_array('node', $config), 'hook_skinr_config_info() in a custom path found.');
  foreach ($config as $key => $type) {
    if ($type == 'node') {
      unset($config[$key]);
    }
  }

  // Ensure that skinr_test_incompatible is not included.
  $this
    ->verbose(highlight_string('<?php ' . var_export($config, TRUE), TRUE));
  $this
    ->assertTrue(!isset($config['skinr_test_incompatible']), 'Incompatible hook_skinr_config_info() not found.');

  // After asserting all expected, the list of skins should be empty.
  $this
    ->assertTrue(empty($config), 'No unexpected skins found.');
}