/** * Tests the extract Method. * * @group JArchive * @return void * * @covers Joomla\Archive\Tar::extract * @covers Joomla\Archive\Tar::getTarInfo */ public function testExtract() { if (!ArchiveTar::isSupported()) { $this->markTestSkipped('Tar files can not be extracted.'); return; } $this->object->extract(__DIR__ . '/logo.tar', self::$outputPath); $this->assertTrue(is_file(self::$outputPath . '/logo-tar.png')); if (is_file(self::$outputPath . '/logo-tar.png')) { unlink(self::$outputPath . '/logo-tar.png'); } }
/** * Tests extracting TAR. * * @return void * * @covers Joomla\Archive\Archive::extract * @since 1.0 */ public function testExtractTar() { if (!is_dir($this->outputPath)) { $this->markTestSkipped("Couldn't create folder."); return; } if (!ArchiveTar::isSupported()) { $this->markTestSkipped('Tar files can not be extracted.'); return; } $this->fixture->extract(__DIR__ . '/logo.tar', $this->outputPath); $this->assertTrue(is_file($this->outputPath . '/logo-tar.png')); if (is_file($this->outputPath . '/logo-tar.png')) { unlink($this->outputPath . '/logo-tar.png'); } }
/** * Tests the isSupported Method. * * @group JArchive * @return void * * @covers Joomla\Archive\Tar::isSupported */ public function testIsSupported() { $this->assertTrue(ArchiveTar::isSupported()); }