More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / modules / rest / tests / src / Functional / EntityResource / Menu / MenuResourceTestBase.php
1 <?php
2
3 namespace Drupal\Tests\rest\Functional\EntityResource\Menu;
4
5 use Drupal\system\Entity\Menu;
6 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
7
8 abstract class MenuResourceTestBase extends EntityResourceTestBase {
9
10   /**
11    * {@inheritdoc}
12    */
13   public static $modules = [];
14
15   /**
16    * {@inheritdoc}
17    */
18   protected static $entityTypeId = 'menu';
19
20   /**
21    * @var \Drupal\system\MenuInterface
22    */
23   protected $entity;
24
25   /**
26    * {@inheritdoc}
27    */
28   protected function setUpAuthorization($method) {
29     $this->grantPermissionsToTestedRole(['administer menu']);
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function createEntity() {
36     $menu = Menu::create([
37       'id' => 'menu',
38       'label' => 'Menu',
39       'description' => 'Menu',
40     ]);
41     $menu->save();
42
43     return $menu;
44   }
45
46   /**
47    * {@inheritdoc}
48    */
49   protected function getExpectedNormalizedEntity() {
50     return [
51       'dependencies' => [],
52       'description' => 'Menu',
53       'id' => 'menu',
54       'label' => 'Menu',
55       'langcode' => 'en',
56       'locked' => FALSE,
57       'status' => TRUE,
58       'uuid' => $this->entity->uuid(),
59     ];
60   }
61
62   /**
63    * {@inheritdoc}
64    */
65   protected function getNormalizedPostEntity() {
66     // @todo Update in https://www.drupal.org/node/2300677.
67   }
68
69   /**
70    * {@inheritdoc}
71    */
72   protected function getExpectedCacheContexts() {
73     return [
74       'user.permissions',
75     ];
76   }
77
78 }