/** * Set up new image listener with mock dependencies. */ public function setUp() { parent::setUp(); $this->imagePreProcessor = $this->makeMock(ImagePreProcessor::class); $this->config = $this->makeMock(Repository::class); $this->publicFilesystem = $this->makeMock(FilesystemAdapter::class); $this->filesystem = $this->makeMock(FilesystemInterface::class); $this->publicFilesystem->expects($this->any())->method('getDriver')->willReturn($this->filesystem); $this->newImageListener = new NewImageListener($this->imagePreProcessor, $this->publicFilesystem, $this->config); $this->image = $this->makeMock(Image::class); $this->event = new NewImageEvent($this->image); }