createMock(UserSourceDirectorInterface::class); $requestedUserService = $this->createMock(RequestedUserServiceInterface::class); $requestedUserService->method('getUserSourceDirector')->willReturn($userSourceDirector); $service = new RequestedActionService($requestedUserService); $this->assertInstanceOf(RequestedActionServiceInterface::class, $service); } }