088a872798bd51e019f06f82ab97bfa391ed4f28
[yaffs-website] / web / core / modules / contact / tests / src / Functional / Hal / MessageHalJsonAnonTest.php
1 <?php
2
3 namespace Drupal\Tests\contact\Functional\Hal;
4
5 use Drupal\Tests\contact\Functional\Rest\MessageResourceTestBase;
6 use Drupal\Tests\hal\Functional\EntityResource\HalEntityNormalizationTrait;
7 use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
8
9 /**
10  * @group hal
11  */
12 class MessageHalJsonAnonTest extends MessageResourceTestBase {
13
14   use HalEntityNormalizationTrait;
15   use AnonResourceTestTrait;
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $modules = ['hal'];
21
22   /**
23    * {@inheritdoc}
24    */
25   protected static $format = 'hal_json';
26
27   /**
28    * {@inheritdoc}
29    */
30   protected static $mimeType = 'application/hal+json';
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function getNormalizedPostEntity() {
36     return parent::getNormalizedPostEntity() + [
37       '_links' => [
38         'type' => [
39           'href' => $this->baseUrl . '/rest/type/contact_message/camelids',
40         ],
41       ],
42     ];
43   }
44
45 }