public function testBatchGenerate() { $times = ['00:00:00:01', '00:00:00:11', '00:00:00:21']; foreach ($times as $time) { $timecode = TimeCode::fromString($time); $this->ffmpeg->open('1.mp4')->willReturn($this->video->reveal())->shouldBeCalled(); $this->video->frame($timecode)->willReturn($this->frame->reveal())->shouldBeCalled(); $this->frame->save(str_replace(':', '.', '/' . $time . '.jpg'))->shouldBeCalled(); } $this->videoThumbnailService->batchGenerate('1.mp4', $times, ''); }