File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,8 @@ public function showShare($path = ''): TemplateResponse {
445445 \OCP \Util::addHeader ('meta ' , ['property ' => "og:type " , 'content ' => "object " ]);
446446 \OCP \Util::addHeader ('meta ' , ['property ' => "og:image " , 'content ' => $ ogPreview ]);
447447
448- $ this ->eventDispatcher ->dispatch ('OCA\Files_Sharing::loadAdditionalScripts ' );
448+ $ event = new GenericEvent (null , ['share ' => $ share ]);
449+ $ this ->eventDispatcher ->dispatch ('OCA\Files_Sharing::loadAdditionalScripts ' , $ event );
449450
450451 $ csp = new \OCP \AppFramework \Http \ContentSecurityPolicy ();
451452 $ csp ->addAllowedFrameDomain ('\'self \'' );
Original file line number Diff line number Diff line change @@ -254,7 +254,12 @@ public function testShowShare() {
254254
255255 $ this ->eventDispatcher ->expects ($ this ->once ())
256256 ->method ('dispatch ' )
257- ->with ('OCA\Files_Sharing::loadAdditionalScripts ' );
257+ ->with (
258+ 'OCA\Files_Sharing::loadAdditionalScripts ' ,
259+ $ this ->callback (function ($ event ) use ($ share ) {
260+ return $ event ->getArgument ('share ' ) === $ share ;
261+ })
262+ );
258263
259264 $ this ->l10n ->expects ($ this ->any ())
260265 ->method ('t ' )
@@ -374,7 +379,12 @@ public function testShowShareHideDownload() {
374379
375380 $ this ->eventDispatcher ->expects ($ this ->once ())
376381 ->method ('dispatch ' )
377- ->with ('OCA\Files_Sharing::loadAdditionalScripts ' );
382+ ->with (
383+ 'OCA\Files_Sharing::loadAdditionalScripts ' ,
384+ $ this ->callback (function ($ event ) use ($ share ) {
385+ return $ event ->getArgument ('share ' ) === $ share ;
386+ })
387+ );
378388
379389 $ this ->l10n ->expects ($ this ->any ())
380390 ->method ('t ' )
You can’t perform that action at this time.
0 commit comments