createMock(AuthorizationCheckerInterface::class); $authorization->expects($this->any())->method('isGranted')->willReturn($isGranted); $service = new ReportingService($eventDispatcher, $authorization); return new ReportingExtension($service); } public function testRenderWidgetForInvalidValue() { $sut = $this->getSut(true); $reports = $sut->getAvailableReports(new User()); $this->assertCount(3, $reports); } }