/** * Should be able to trigger events to transfer local images. */ public function testTransferLocalImages() { $image = $this->makeMock(Image::class); $this->imageResource->shouldReceive('orWhere->get')->atLeast()->once()->andReturn(new Collection([$image])); $this->dispatcher->expects($this->atLeastOnce())->method('fire')->with($this->callback(function (NewImageEvent $event) use($image) { $this->assertSame($image, $event->image()); return true; })); $this->imageRepository->transferLocalImages(); }