MetatagFieldTermTest.php in Metatag 8
File
tests/src/Functional/MetatagFieldTermTest.php
View source
<?php
namespace Drupal\Tests\metatag\Functional;
use Drupal\Core\StringTranslation\StringTranslationTrait;
class MetatagFieldTermTest extends MetatagFieldTestBase {
use StringTranslationTrait;
protected static $modules = [
'token',
'field_ui',
'contact',
'metatag',
'metatag_test_tag',
'taxonomy',
];
protected $entityPerms = [
'administer taxonomy_term fields',
'administer taxonomy',
'edit terms in tags',
'delete terms in tags',
];
protected $entityType = 'taxonomy_term';
protected $entityLabel = 'Taxonomy term';
protected $entityBundle = 'entity_test';
protected $entityAddPath = 'admin/structure/taxonomy/manage/tags/add';
protected $entityFieldAdminPath = 'admin/structure/taxonomy/manage/tags/overview/fields';
protected $entityTitleField = 'name';
protected function setUpEntityType() {
$new_perms = [
'administer taxonomy',
];
$all_perms = array_merge($this->basePerms, $new_perms);
$this->adminUser = $this
->drupalCreateUser($all_perms);
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/structure/taxonomy/add');
$this
->assertSession()
->statusCodeEquals(200);
$edit = [
'name' => 'Tags',
'vid' => 'tags',
];
$this
->drupalPostForm(NULL, $edit, $this
->t('Save'));
$this
->drupalLogout();
}
}