diff --git a/tests/metatag.unit.test b/tests/metatag.unit.test index 1d7237b..9cefde7 100644 --- a/tests/metatag.unit.test +++ b/tests/metatag.unit.test @@ -70,10 +70,6 @@ class MetatagUnitTest extends MetatagTestHelper { public function testEntitySupport() { // Create an empty config for the node types so that we can disable them. $config = new stdClass(); - $config->instance = 'node:article'; - $config->config = array(); - metatag_config_save($config); - $config = new stdClass(); $config->instance = 'node:page'; $config->config = array(); metatag_config_save($config); @@ -101,7 +97,7 @@ class MetatagUnitTest extends MetatagTestHelper { $this->assertMetatagEntitySupportsMetatags($test_case['type'], $test_case['bundle'], $test_case['expected']); } - metatag_entity_type_disable('node', 'article'); + metatag_entity_type_disable('node'); metatag_entity_type_disable('taxonomy_term'); $test_cases[0]['expected'] = FALSE; @@ -113,6 +109,20 @@ class MetatagUnitTest extends MetatagTestHelper { $test_case += array('bundle' => NULL); $this->assertMetatagEntitySupportsMetatags($test_case['type'], $test_case['bundle'], $test_case['expected']); } + + // Add a new config for the article node type, which should toggle + // support for nodes back on. + $config = new stdClass(); + $config->instance = 'node:article'; + $config->config = array(); + metatag_config_save($config); + + $test_cases[0]['expected'] = TRUE; + $test_cases[1]['expected'] = TRUE; + foreach ($test_cases as $test_case) { + $test_case += array('bundle' => NULL); + $this->assertMetatagEntitySupportsMetatags($test_case['type'], $test_case['bundle'], $test_case['expected']); + } } function assertMetatagEntitySupportsMetatags($entity_type, $bundle, $expected) {