@@ -42,7 +42,30 @@ public function emailViewHelperWorksAlsoWithSpamProtection()
4242 public function viewHelperOutputsUri ()
4343 {
4444 $ requestArguments = ['url ' => $ this ->getRenderUrl (1 , 1 , 'lib.viewHelper ' )];
45- $ expectedContent = '/index.php?id=1&L=1&tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo&cHash= ' ;
46- $ this ->assertSame (0 , strpos (trim ($ this ->fetchFrontendResponse ($ requestArguments )->getContent ()), $ expectedContent ));
45+ $ actualContentWithoutCHash = preg_replace ('/&cHash=[a-z0-9]*/ ' , '' , trim ($ this ->fetchFrontendResponse ($ requestArguments )->getContent ()));
46+ $ expectedContent = '/index.php?id=1&L=1&tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo ' ;
47+ $ this ->assertSame ($ expectedContent , $ actualContentWithoutCHash );
48+ }
49+
50+ /**
51+ * @test
52+ */
53+ public function oldViewHelperOutputsUri ()
54+ {
55+ $ requestArguments = ['url ' => $ this ->getRenderUrl (1 , 1 , 'lib.oldViewHelper ' )];
56+ $ actualContentWithoutCHash = preg_replace ('/&cHash=[a-z0-9]*/ ' , '' , trim ($ this ->fetchFrontendResponse ($ requestArguments )->getContent ()));
57+ $ expectedContent = '/index.php?id=1&L=1&tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo ' ;
58+ $ this ->assertSame ($ expectedContent , $ actualContentWithoutCHash );
59+ }
60+
61+ /**
62+ * @test
63+ */
64+ public function linkViewHelperOutputsUri ()
65+ {
66+ $ requestArguments = ['url ' => $ this ->getRenderUrl (1 , 1 , 'lib.linkViewHelper ' )];
67+ $ actualContentWithoutCHash = preg_replace ('/&cHash=[a-z0-9]*/ ' , '' , trim ($ this ->fetchFrontendResponse ($ requestArguments )->getContent ()));
68+ $ expectedContent = '<a href="/index.php?id=1&L=1&tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo">Link</a> ' ;
69+ $ this ->assertSame ($ expectedContent , $ actualContentWithoutCHash );
4770 }
4871}
0 commit comments