userPrivilegeRetriever = $this->createMock(RolePrivilegeRetriever::class); $serviceLocator = $this->getServiceLocatorMock( [ DataBaseAccess::SERVICE_ID => $this->createMock(DataBaseAccess::class), RolePrivilegeRetriever::class => $this->userPrivilegeRetriever, ] ); $this->sut = new PermissionProvider(); $this->sut->setServiceLocator($serviceLocator); } public function testGetResourceAccessData(): void { $this->userPrivilegeRetriever ->method('retrieveByResourceIds') ->with(['id']) ->willReturn([]); self::assertSame([], $this->sut->getResourceAccessData('id')); } }