@@ -79,33 +79,33 @@ protected function setUp(): void {
79
79
80
80
$ this ->controller = $ this ->getMockBuilder (Controller::class)
81
81
->disableOriginalConstructor ()
82
- ->getMock ();
82
+ ->getMock ();
83
83
$ this ->reader = new ControllerMethodReflector ();
84
84
$ this ->logger = $ this ->getMockBuilder (
85
85
ILogger::class
86
86
)
87
- ->disableOriginalConstructor ()
88
- ->getMock ();
87
+ ->disableOriginalConstructor ()
88
+ ->getMock ();
89
89
$ this ->navigationManager = $ this ->getMockBuilder (
90
90
INavigationManager::class
91
91
)
92
- ->disableOriginalConstructor ()
93
- ->getMock ();
92
+ ->disableOriginalConstructor ()
93
+ ->getMock ();
94
94
$ this ->urlGenerator = $ this ->getMockBuilder (
95
95
IURLGenerator::class
96
96
)
97
- ->disableOriginalConstructor ()
98
- ->getMock ();
97
+ ->disableOriginalConstructor ()
98
+ ->getMock ();
99
99
$ this ->request = $ this ->getMockBuilder (
100
100
IRequest::class
101
101
)
102
- ->disableOriginalConstructor ()
103
- ->getMock ();
102
+ ->disableOriginalConstructor ()
103
+ ->getMock ();
104
104
$ this ->contentSecurityPolicyManager = $ this ->getMockBuilder (
105
105
ContentSecurityPolicyManager::class
106
106
)
107
- ->disableOriginalConstructor ()
108
- ->getMock ();
107
+ ->disableOriginalConstructor ()
108
+ ->getMock ();
109
109
$ this ->middleware = $ this ->getMiddleware (true , true );
110
110
$ this ->secException = new SecurityException ('hey ' , false );
111
111
$ this ->secAjaxException = new SecurityException ('hey ' , true );
@@ -252,8 +252,8 @@ public function testAjaxStatusAllGood() {
252
252
*/
253
253
public function testNoChecks () {
254
254
$ this ->request ->expects ($ this ->never ())
255
- ->method ('passesCSRFCheck ' )
256
- ->will ($ this ->returnValue (false ));
255
+ ->method ('passesCSRFCheck ' )
256
+ ->will ($ this ->returnValue (false ));
257
257
258
258
$ sec = $ this ->getMiddleware (false , false );
259
259
@@ -388,30 +388,30 @@ public function testAfterExceptionNotCaughtThrowsItAgain() {
388
388
public function testAfterExceptionReturnsRedirectForNotLoggedInUser () {
389
389
$ this ->request = new Request (
390
390
[
391
- 'server ' =>
392
- [
393
- 'HTTP_ACCEPT ' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ' ,
394
- 'REQUEST_URI ' => 'owncloud/index.php/apps/specialapp '
395
- ]
396
- ],
391
+ 'server ' =>
392
+ [
393
+ 'HTTP_ACCEPT ' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ' ,
394
+ 'REQUEST_URI ' => 'owncloud/index.php/apps/specialapp '
395
+ ]
396
+ ],
397
397
$ this ->createMock (ISecureRandom::class),
398
398
$ this ->createMock (IConfig::class)
399
399
);
400
400
$ this ->middleware = $ this ->getMiddleware (false , false );
401
401
$ this ->urlGenerator
402
- ->expects ($ this ->once ())
403
- ->method ('linkToRoute ' )
404
- ->with (
405
- 'core.login.showLoginForm ' ,
406
- [
407
- 'redirect_url ' => 'owncloud%2Findex.php%2Fapps%2Fspecialapp ' ,
408
- ]
409
- )
410
- ->will ($ this ->returnValue ('http://localhost/index.php/login?redirect_url=owncloud%2Findex.php%2Fapps%2Fspecialapp ' ));
402
+ ->expects ($ this ->once ())
403
+ ->method ('linkToRoute ' )
404
+ ->with (
405
+ 'core.login.showLoginForm ' ,
406
+ [
407
+ 'redirect_url ' => 'owncloud%2Findex.php%2Fapps%2Fspecialapp ' ,
408
+ ]
409
+ )
410
+ ->will ($ this ->returnValue ('http://localhost/index.php/login?redirect_url=owncloud%2Findex.php%2Fapps%2Fspecialapp ' ));
411
411
$ this ->logger
412
- ->expects ($ this ->once ())
413
- ->method ('debug ' )
414
- ->with ('Current user is not logged in ' );
412
+ ->expects ($ this ->once ())
413
+ ->method ('debug ' )
414
+ ->with ('Current user is not logged in ' );
415
415
$ response = $ this ->middleware ->afterException (
416
416
$ this ->controller ,
417
417
'test ' ,
@@ -447,20 +447,20 @@ public function exceptionProvider() {
447
447
public function testAfterExceptionReturnsTemplateResponse (SecurityException $ exception ) {
448
448
$ this ->request = new Request (
449
449
[
450
- 'server ' =>
451
- [
452
- 'HTTP_ACCEPT ' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ' ,
453
- 'REQUEST_URI ' => 'owncloud/index.php/apps/specialapp '
454
- ]
455
- ],
450
+ 'server ' =>
451
+ [
452
+ 'HTTP_ACCEPT ' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ' ,
453
+ 'REQUEST_URI ' => 'owncloud/index.php/apps/specialapp '
454
+ ]
455
+ ],
456
456
$ this ->createMock (ISecureRandom::class),
457
457
$ this ->createMock (IConfig::class)
458
458
);
459
459
$ this ->middleware = $ this ->getMiddleware (false , false );
460
460
$ this ->logger
461
- ->expects ($ this ->once ())
462
- ->method ('debug ' )
463
- ->with ($ exception ->getMessage ());
461
+ ->expects ($ this ->once ())
462
+ ->method ('debug ' )
463
+ ->with ($ exception ->getMessage ());
464
464
$ response = $ this ->middleware ->afterException (
465
465
$ this ->controller ,
466
466
'test ' ,
@@ -628,10 +628,10 @@ public function testAfterController() {
628
628
->method ('getDefaultPolicy ' )
629
629
->willReturn ($ defaultPolicy );
630
630
$ this ->contentSecurityPolicyManager
631
- ->expects ($ this ->once ())
632
- ->method ('mergePolicies ' )
633
- ->with ($ defaultPolicy , $ currentPolicy )
634
- ->willReturn ($ mergedPolicy );
631
+ ->expects ($ this ->once ())
632
+ ->method ('mergePolicies ' )
633
+ ->with ($ defaultPolicy , $ currentPolicy )
634
+ ->willReturn ($ mergedPolicy );
635
635
$ response ->expects ($ this ->once ())
636
636
->method ('setContentSecurityPolicy ' )
637
637
->with ($ mergedPolicy );
0 commit comments