3 namespace Drupal\metatag\Tests;
5 use Drupal\Core\Cache\Cache;
6 use Drupal\metatag\Tests\MetatagFieldTestBase;
9 * Ensures that the Metatag field works correctly on taxonomy terms.
13 class MetatagFieldTermTest extends MetatagFieldTestBase {
18 public static $modules = [
19 // Needed for token handling.
22 // Needed for the field UI testing.
25 // Needed to verify that nothing is broken for unsupported entities.
31 // Some extra custom logic for testing Metatag.
34 // Manages the entity type that is being tested.
41 protected $entity_perms = [
43 'administer taxonomy_term fields',
46 'administer taxonomy',
48 'delete terms in tags',
54 protected $entity_type = 'taxonomy_term';
59 protected $entity_label = 'Taxonomy term';
64 protected $entity_bundle = 'entity_test';
69 protected $entity_add_path = 'admin/structure/taxonomy/manage/tags/add';
74 protected $entity_field_admin_path = 'admin/structure/taxonomy/manage/tags/overview/fields';
79 protected $entity_title_field = 'name';
84 protected function setUpEntityType() {
87 'administer taxonomy',
89 $all_perms = array_merge($this->base_perms, $new_perms);
90 $this->adminUser = $this->drupalCreateUser($all_perms);
91 $this->drupalLogin($this->adminUser);
92 $this->drupalGet('admin/structure/taxonomy/add');
93 $this->assertResponse(200);
98 $this->drupalPostForm(NULL, $edit, t('Save'));
99 $this->drupalLogout();