X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fblock_content%2Ftests%2Fsrc%2FFunctional%2FHal%2FBlockContentHalJsonAnonTest.php;fp=web%2Fcore%2Fmodules%2Fblock_content%2Ftests%2Fsrc%2FFunctional%2FHal%2FBlockContentHalJsonAnonTest.php;h=33c1108d24864334da0ad7ca1fcbafaeb6600275;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=0000000000000000000000000000000000000000;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/block_content/tests/src/Functional/Hal/BlockContentHalJsonAnonTest.php b/web/core/modules/block_content/tests/src/Functional/Hal/BlockContentHalJsonAnonTest.php new file mode 100644 index 000000000..33c1108d2 --- /dev/null +++ b/web/core/modules/block_content/tests/src/Functional/Hal/BlockContentHalJsonAnonTest.php @@ -0,0 +1,74 @@ +applyHalFieldNormalization($default_normalization); + + return $normalization + [ + '_links' => [ + 'self' => [ + 'href' => $this->baseUrl . '/block/1?_format=hal_json', + ], + 'type' => [ + 'href' => $this->baseUrl . '/rest/type/block_content/basic', + ], + ], + ]; + } + + /** + * {@inheritdoc} + */ + protected function getNormalizedPostEntity() { + return parent::getNormalizedPostEntity() + [ + '_links' => [ + 'type' => [ + 'href' => $this->baseUrl . '/rest/type/block_content/basic', + ], + ], + ]; + } + + /** + * {@inheritdoc} + */ + protected function getExpectedCacheContexts() { + // The 'url.site' cache context is added for '_links' in the response. + return Cache::mergeTags(parent::getExpectedCacheContexts(), ['url.site']); + } + +}