@@ -40,13 +40,13 @@ protected function setUp(): void
4040 $ viewOpensStatisticsNormalizer = new ViewOpensStatisticsNormalizer ();
4141 $ topDomainsNormalizer = new TopDomainsNormalizer ();
4242 $ this ->controller = new DummyAnalyticsController (
43- $ this ->authentication ,
44- $ validator ,
45- $ this ->analyticsService ,
46- $ campaignStatisticsNormalizer ,
47- $ viewOpensStatisticsNormalizer ,
48- $ topDomainsNormalizer ,
49- new TopLocalPartsNormalizer ()
43+ authentication: $ this ->authentication ,
44+ validator: $ validator ,
45+ analyticsService: $ this ->analyticsService ,
46+ campaignStatsNormalizer: $ campaignStatisticsNormalizer ,
47+ viewOpensStatsNormalizer: $ viewOpensStatisticsNormalizer ,
48+ topDomainsNormalizer: $ topDomainsNormalizer ,
49+ topLocalPartsNormalizer: new TopLocalPartsNormalizer ()
5050 );
5151
5252 $ this ->privileges = $ this ->createMock (Privileges::class);
@@ -443,7 +443,7 @@ public function testGetTopLocalPartsReturnsJsonResponse(): void
443443 ], json_decode ($ response ->getContent (), true ));
444444 }
445445
446- public function testGetDashboardStatisticsWithoutStatisticsPrivilegeThrowsException (): void
446+ public function testGetDashboardStatisticsWithoutStatisticsPrivilegeDoesNotThrowException (): void
447447 {
448448 $ request = new Request ();
449449
@@ -454,14 +454,11 @@ public function testGetDashboardStatisticsWithoutStatisticsPrivilegeThrowsExcept
454454 ->willReturn ($ this ->administrator );
455455
456456 $ this ->privileges
457- ->expects (self ::once ())
457+ ->expects (self ::never ())
458458 ->method ('has ' )
459459 ->with (PrivilegeFlag::Statistics)
460460 ->willReturn (false );
461461
462- $ this ->expectException (AccessDeniedException::class);
463- $ this ->expectExceptionMessage ('You are not allowed to access statistics. ' );
464-
465462 $ this ->controller ->getDashboardStatistics ($ request );
466463 }
467464
@@ -476,7 +473,7 @@ public function testGetDashboardStatisticsReturnsJsonResponse(): void
476473 ->willReturn ($ this ->administrator );
477474
478475 $ this ->privileges
479- ->expects (self ::once ())
476+ ->expects (self ::never ())
480477 ->method ('has ' )
481478 ->with (PrivilegeFlag::Statistics)
482479 ->willReturn (true );
0 commit comments