From d88604015a0828e78a05bf7f1ee80bb78f980dae Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 1 Feb 2019 10:34:58 +0100 Subject: No need to emit additonalscript event on public pages There already is a separate event for this. This will make it possible to only inject code with the logged in one on default rendered pages. Signed-off-by: Roeland Jago Douma --- .../Middleware/AdditionalScriptsMiddlewareTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/AppFramework/Middleware') diff --git a/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php b/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php index 27a6e70c641..2a789a848a3 100644 --- a/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php @@ -28,6 +28,7 @@ use OC\AppFramework\Middleware\AdditionalScriptsMiddleware; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\PublicShareController; use OCP\IUserSession; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -67,6 +68,15 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase { $this->middleWare->afterController($this->controller, 'myMethod', $this->createMock(Response::class)); } + public function testPublicShareController() { + $this->dispatcher->expects($this->never()) + ->method($this->anything()); + $this->userSession->expects($this->never()) + ->method($this->anything()); + + $this->middleWare->afterController($this->createMock(PublicShareController::class), 'myMethod', $this->createMock(Response::class)); + } + public function testTemplateResponseNotLoggedIn() { $this->dispatcher->expects($this->once()) ->method('dispatch') -- cgit v1.2.3