You are here

public function MetatagCoreUnitTest::testConfigLabels in Metatag 7

Test the metatag_config_instance_label() function.

File

tests/MetatagCoreUnitTest.test, line 125
Unit tests for the Metatag module.

Class

MetatagCoreUnitTest
Unit tests for the Metatag module.

Code

public function testConfigLabels() {
  $test_cases = array(
    'node' => 'Node',
    'node:article' => 'Node: Article',
    'node:article:c' => 'Node: Article: Unknown (c)',
    'node:b' => 'Node: Unknown (b)',
    'node:b:c' => 'Node: Unknown (b): Unknown (c)',
    'a' => 'Unknown (a)',
    'a:b' => 'Unknown (a): Unknown (b)',
    'a:b:c' => 'Unknown (a): Unknown (b): Unknown (c)',
    'a:b:c:d' => 'Unknown (a): Unknown (b): Unknown (c): Unknown (d)',
  );
  foreach ($test_cases as $input => $expected_output) {
    drupal_static_reset('metatag_config_instance_label');
    $actual_output = metatag_config_instance_label($input);
    $this
      ->assertEqual($actual_output, $expected_output);
  }
}