/** * Test... * * @covers Joomla\Archive\Zip::checkZipData * * @return void */ public function testCheckZipData() { $dataZip = file_get_contents(__DIR__ . '/logo.zip'); $this->assertTrue($this->object->checkZipData($dataZip)); $dataTar = file_get_contents(__DIR__ . '/logo.tar'); $this->assertFalse($this->object->checkZipData($dataTar)); }
/** * Tests extracting ZIP. * * @return void * * @covers Joomla\Archive\Archive::extract * @since 1.0 */ public function testExtractZip() { if (!is_dir($this->outputPath)) { $this->markTestSkipped("Couldn't create folder."); return; } if (!ArchiveZip::isSupported()) { $this->markTestSkipped('ZIP files can not be extracted.'); return; } $this->fixture->extract(__DIR__ . '/logo.zip', $this->outputPath); $this->assertTrue(is_file($this->outputPath . '/logo-zip.png')); if (is_file($this->outputPath . '/logo-zip.png')) { unlink($this->outputPath . '/logo-zip.png'); } }
/** * Test... * * @param string $archive @todo * @param string $destination @todo * @param array $options @todo * * @return bool */ public function accessExtractNative($archive, $destination, array $options = array()) { return parent::extractNative($archive, $destination, $options); }
/** * Tests the isSupported Method. * * @group JArchive * @return void * * @covers Joomla\Archive\Zip::isSupported * @depends testHasNativeSupport */ public function testIsSupported() { $this->assertEquals(ArchiveZip::hasNativeSupport() || extension_loaded('zlib'), ArchiveZip::isSupported()); }