Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block_content / tests / src / Functional / Rest / BlockContentTypeResourceTestBase.php
1 <?php
2
3 namespace Drupal\Tests\block_content\Functional\Rest;
4
5 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
6 use Drupal\block_content\Entity\BlockContentType;
7
8 abstract class BlockContentTypeResourceTestBase extends EntityResourceTestBase {
9
10   /**
11    * {@inheritdoc}
12    */
13   public static $modules = ['block_content'];
14
15   /**
16    * {@inheritdoc}
17    */
18   protected static $entityTypeId = 'block_content_type';
19
20   /**
21    * @var \Drupal\block_content\Entity\BlockContentTypeInterface
22    */
23   protected $entity;
24
25   /**
26    * {@inheritdoc}
27    */
28   protected function setUpAuthorization($method) {
29     $this->grantPermissionsToTestedRole(['administer blocks']);
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function createEntity() {
36     $block_content_type = BlockContentType::create([
37       'id' => 'pascal',
38       'label' => 'Pascal',
39       'revision' => FALSE,
40       'description' => 'Provides a competitive alternative to the "basic" type',
41     ]);
42
43     $block_content_type->save();
44
45     return $block_content_type;
46   }
47
48   /**
49    * {@inheritdoc}
50    */
51   protected function getExpectedNormalizedEntity() {
52     return [
53       'dependencies' => [],
54       'description' => 'Provides a competitive alternative to the "basic" type',
55       'id' => 'pascal',
56       'label' => 'Pascal',
57       'langcode' => 'en',
58       'revision' => 0,
59       'status' => TRUE,
60       'uuid' => $this->entity->uuid(),
61     ];
62   }
63
64   /**
65    * {@inheritdoc}
66    */
67   protected function getNormalizedPostEntity() {
68     // @todo Update in https://www.drupal.org/node/2300677.
69   }
70
71 }