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 users.
13 class MetatagFieldUserTest 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 user fields',
46 'administer account settings',
53 protected $entity_type = 'user';
58 protected $entity_label = 'User';
63 protected $entity_bundle = 'user';
68 protected $entity_add_path = 'admin/people/create';
73 protected $entity_field_admin_path = 'admin/config/people/accounts/fields';
78 protected $entity_title_field = 'name';
83 protected $entity_save_button_label = 'Create new account';
88 protected function entity_default_values($title = 'Barfoo') {
89 $password = $this->randomString(16);
91 'mail' => 'test' . $this->adminUser->getEmail(),
93 'pass[pass1]' => $password,
94 'pass[pass2]' => $password,
99 * Confirm the metatag field can be shown on a user registration page.
103 // protected function testFieldsOnUserRegistrationForm() {}
106 * Confirm the metatag field can be shown on a normal user's own edit form.
110 // protected function testFieldsOnUserEditForm() {}