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