diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-02-01 10:34:58 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-02-05 20:59:36 +0100 |
commit | d88604015a0828e78a05bf7f1ee80bb78f980dae (patch) | |
tree | 8ea665bbc1f6c1c811c4eef7d582705e4efe0420 /tests | |
parent | 780e1485c85bf31f1bae9221436798f25810fc72 (diff) | |
download | nextcloud-server-d88604015a0828e78a05bf7f1ee80bb78f980dae.tar.gz nextcloud-server-d88604015a0828e78a05bf7f1ee80bb78f980dae.zip |
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 <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php | 10 |
1 files changed, 10 insertions, 0 deletions
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') |