mediaResolver = $this->createMock(TaoMediaResolver::class); $this->subject = new IdDiscoverService(); $this->subject->withMediaResolver($this->mediaResolver); } public function testDiscover(): void { $this->mediaResolver ->method('resolve') ->willReturnOnConsecutiveCalls( ... [ new MediaAsset(new MediaSource(), self::MEDIA_LINK_1_URI), new MediaAsset(new MediaSource(), self::MEDIA_LINK_2_URI), new MediaAsset(new MediaSource(), self::MEDIA_LINK_3_URI), ] ); $this->assertSame( [ self::MEDIA_LINK_1_PARSED, self::MEDIA_LINK_2_PARSED, self::MEDIA_LINK_3_PARSED ], $this->subject->discover( [ self::MEDIA_LINK_1, self::MEDIA_LINK_2, self::MEDIA_LINK_3 ] ) ); } }