3 namespace Drupal\metatag\Tests;
6 * Ensures that the Metatag field works correctly on taxonomy terms.
10 class MetatagFieldTermTest extends MetatagFieldTestBase {
15 public static $modules = [
16 // Needed for token handling.
19 // Needed for the field UI testing.
22 // Needed to verify that nothing is broken for unsupported entities.
28 // Some extra custom logic for testing Metatag.
31 // Manages the entity type that is being tested.
38 protected $entityPerms = [
40 'administer taxonomy_term fields',
43 'administer taxonomy',
45 'delete terms in tags',
51 protected $entityType = 'taxonomy_term';
56 protected $entityLabel = 'Taxonomy term';
61 protected $entityBundle = 'entity_test';
66 protected $entityAddPath = 'admin/structure/taxonomy/manage/tags/add';
71 protected $entityFieldAdminPath = 'admin/structure/taxonomy/manage/tags/overview/fields';
76 protected $entityTitleField = 'name';
81 protected function setUpEntityType() {
84 'administer taxonomy',
86 $all_perms = array_merge($this->basePerms, $new_perms);
87 $this->adminUser = $this->drupalCreateUser($all_perms);
88 $this->drupalLogin($this->adminUser);
89 $this->drupalGet('admin/structure/taxonomy/add');
90 $this->assertResponse(200);
95 $this->drupalPostForm(NULL, $edit, t('Save'));
96 $this->drupalLogout();