From 1c51b6608f4e5e9dc4f40b0f8eb64925285c4556 Mon Sep 17 00:00:00 2001 From: Jen Lampton Date: Tue, 22 Nov 2016 12:06:23 -0800 Subject: [PATCH] Restore standard testing profile for unit test, update docs. --- metatag.module | 9 ++++----- tests/metatag.unit.test | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/metatag.module b/metatag.module index 865bda3..2d9f299 100644 --- a/metatag.module +++ b/metatag.module @@ -1604,16 +1604,15 @@ function metatag_entity_supports_metatags($entity_type = NULL, $bundle = NULL) { $entity_types = &backdrop_static(__FUNCTION__); $settings = config('metatag.settings'); - // Identify which entities & bundles are supported the first time the - // function is called. + // Identify which entities & bundles are supported. if (!isset($entity_types)) { foreach (entity_get_info() as $entity_name => $entity_info) { + // Verify that this entity type is suitable. $entity_types[$entity_name] = metatag_entity_type_is_suitable($entity_name, $entity_info); - - // The entity type technically supports entities. if (!empty($entity_types[$entity_name])) { - // Disable only if overridden. + + // Entiy types are enabled by default, see if they have been disabled. if ($settings->get('metatag_enable_' . $entity_name) == FALSE) { $entity_types[$entity_name] = FALSE; } diff --git a/tests/metatag.unit.test b/tests/metatag.unit.test index 54f6b0f..cb2d73e 100644 --- a/tests/metatag.unit.test +++ b/tests/metatag.unit.test @@ -8,6 +8,7 @@ * @todo These aren't really unit tests, we might need to fix that. */ class MetatagCoreUnitTest extends MetatagTestHelper { + protected $profile = 'standard'; /** * Test the metatag_config_load_with_defaults() function. @@ -15,7 +16,6 @@ class MetatagCoreUnitTest extends MetatagTestHelper { public function testConfigLoadDefaults() { // Load the global defaults, inc the fake entity. $defaults = metatag_config_load_with_defaults('test:foo'); - //ksort($defaults); // Load example value and verify it's the same as the global. $extra_tags = array( @@ -23,7 +23,6 @@ class MetatagCoreUnitTest extends MetatagTestHelper { 'test:foo' => array('value' => 'foobar'), ); $new_values = array_merge($extra_tags, $this->getTestDefaults()); - //ksort($new_values); // Confirm that the values are equal. $this->assertEqual($defaults, $new_values);