|
|
|
|
@ -49,6 +49,7 @@ use OCP\IConfig;
|
|
|
|
|
use OCP\ILogger;
|
|
|
|
|
use OCP\INavigationManager;
|
|
|
|
|
use OCP\IRequest;
|
|
|
|
|
use OCP\ISession;
|
|
|
|
|
use OCP\IURLGenerator;
|
|
|
|
|
use OCP\Security\ISecureRandom;
|
|
|
|
|
|
|
|
|
|
@ -63,6 +64,8 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|
|
|
|
private $secException;
|
|
|
|
|
/** @var SecurityException */
|
|
|
|
|
private $secAjaxException;
|
|
|
|
|
/** @var ISession|\PHPUnit_Framework_MockObject_MockObject */
|
|
|
|
|
private $session;
|
|
|
|
|
/** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */
|
|
|
|
|
private $request;
|
|
|
|
|
/** @var ControllerMethodReflector */
|
|
|
|
|
@ -88,6 +91,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|
|
|
|
$this->logger = $this->createMock(ILogger::class);
|
|
|
|
|
$this->navigationManager = $this->createMock(INavigationManager::class);
|
|
|
|
|
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
|
|
|
|
$this->session = $this->createMock(ISession::class);
|
|
|
|
|
$this->request = $this->createMock(IRequest::class);
|
|
|
|
|
$this->contentSecurityPolicyManager = $this->createMock(ContentSecurityPolicyManager::class);
|
|
|
|
|
$this->csrfTokenManager = $this->createMock(CsrfTokenManager::class);
|
|
|
|
|
@ -109,6 +113,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|
|
|
|
$this->navigationManager,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->logger,
|
|
|
|
|
$this->session,
|
|
|
|
|
'files',
|
|
|
|
|
$isLoggedIn,
|
|
|
|
|
$isAdminUser,
|
|
|
|
|
|