shouldReceive('setData')->once()->with('ARCHIVE', true)->andReturn(true); $archiveInfo->shouldReceive('getFileData')->once()->with('cover.jpg')->andReturn('IMAGE-DATA'); $service = new ArchiveExtractionService( $this->makeConfig(), $archiveInfo, Mockery::mock(Par2Info::class) ); $this->assertSame('IMAGE-DATA', $service->extractSpecificFile('ARCHIVE', 'cover.jpg', sys_get_temp_dir().'/')); } #[Test] public function it_detects_common_standalone_video_signatures(): void { $service = new ArchiveExtractionService( $this->makeConfig(), Mockery::mock(ArchiveInfo::class), Mockery::mock(Par2Info::class) ); $avi = 'RIFF'.str_repeat("\0", 4).'AVI '.str_repeat("\0", 16); $mp4 = str_repeat("\0", 4).'ftypisom'.str_repeat("\0", 16); $this->assertSame('avi', $service->detectStandaloneVideo($avi)); $this->assertSame('mp4', $service->detectStandaloneVideo($mp4)); $this->assertNull($service->detectStandaloneVideo('tiny')); } }