Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / metatag / src / Tests / MetatagFieldNodeTest.php
1 <?php
2
3 namespace Drupal\metatag\Tests;
4
5 /**
6  * Ensures that the Metatag field works correctly on nodes.
7  *
8  * @group metatag
9  */
10 class MetatagFieldNodeTest 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     'node',
33   ];
34
35   /**
36    * {@inheritdoc}
37    */
38   protected $entityPerms = [
39     // From Field UI.
40     'administer node fields',
41
42     // From Node.
43     'access content',
44     'administer content types',
45     'administer nodes',
46     'bypass node access',
47     'create page content',
48     'edit any page content',
49     'edit own page content',
50   ];
51
52   /**
53    * {@inheritdoc}
54    */
55   protected $entityType = 'node';
56
57   /**
58    * {@inheritdoc}
59    */
60   protected $entityLabel = 'Content';
61
62   /**
63    * {@inheritdoc}
64    */
65   protected $entityBundle = 'page';
66
67   /**
68    * {@inheritdoc}
69    */
70   protected $entityAddPath = 'node/add';
71
72   /**
73    * {@inheritdoc}
74    */
75   protected $entityFieldAdminPath = 'admin/structure/types/manage/page/fields';
76
77   /**
78    * {@inheritdoc}
79    */
80   protected function setUpEntityType() {
81     $this->createContentType(['type' => 'page']);
82
83     // 8.3 has the label 'Save and publish'.
84     if ((floatval(\Drupal::VERSION) <= 8.3)) {
85       $this->entitySaveButtonLabel = 'Save and publish';
86     }
87   }
88
89 }