723401414606279371eb5dd2cdbe41ea299ecdb3
[yaffs-website] / web / modules / contrib / metatag / src / Tests / MetatagFieldUserTest.php
1 <?php
2
3 namespace Drupal\metatag\Tests;
4
5 /**
6  * Ensures that the Metatag field works correctly on users.
7  *
8  * @group metatag
9  */
10 class MetatagFieldUserTest extends MetatagFieldTestBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public static $modules = [
16     // Needed for token handling.
17     'token',
18
19     // Needed for the field UI testing.
20     'field_ui',
21
22     // Needed to verify that nothing is broken for unsupported entities.
23     'contact',
24
25     // The base module.
26     'metatag',
27
28     // Some extra custom logic for testing Metatag.
29     'metatag_test_tag',
30
31     // Manages the entity type that is being tested.
32     'user',
33   ];
34
35   /**
36    * {@inheritdoc}
37    */
38   protected $entityPerms = [
39     // From Field UI.
40     'administer user fields',
41
42     // From User.
43     'administer account settings',
44     'administer users',
45   ];
46
47   /**
48    * {@inheritdoc}
49    */
50   protected $entityType = 'user';
51
52   /**
53    * {@inheritdoc}
54    */
55   protected $entityLabel = 'User';
56
57   /**
58    * {@inheritdoc}
59    */
60   protected $entityBundle = 'user';
61
62   /**
63    * {@inheritdoc}
64    */
65   protected $entityAddPath = 'admin/people/create';
66
67   /**
68    * {@inheritdoc}
69    */
70   protected $entityFieldAdminPath = 'admin/config/people/accounts/fields';
71
72   /**
73    * {@inheritdoc}
74    */
75   protected $entityTitleField = 'name';
76
77   /**
78    * {@inheritdoc}
79    */
80   protected $entitySaveButtonLabel = 'Create new account';
81
82   /**
83    * {@inheritdoc}
84    */
85   protected function entityDefaultValues($title = 'Barfoo') {
86     $password = $this->randomString(16);
87     return [
88       'mail' => 'test' . $this->adminUser->getEmail(),
89       'name' => $title,
90       'pass[pass1]' => $password,
91       'pass[pass2]' => $password,
92     ];
93   }
94
95   /**
96    * Confirm the metatag field can be shown on a user registration page.
97    *
98    * @todo
99    */
100   public function testFieldsOnUserRegistrationForm() {}
101
102   /**
103    * Confirm the metatag field can be shown on a normal user's own edit form.
104    *
105    * @todo
106    */
107   public function testFieldsOnUserEditForm() {}
108
109 }