/** * Tests extracting gzip. * * @return void */ public function testExtractGzip() { if (!JArchiveGzip::isSupported()) { $this->markTestSkipped('Gzip files can not be extracted.'); } JArchive::extract(__DIR__ . '/logo-gz.png.gz', $this->outputPath); $this->assertFileExists($this->outputPath . '/logo-gz.png'); }
/** * Tests extracting gzip. * * @return void */ public function testExtractGzip() { if (!JArchiveGzip::isSupported()) { $this->markTestSkipped('Gzip files can not be extracted.'); } // we need a configuration with a tmp_path set $config = JFactory::$config; $config->set('tmp_path', __DIR__ . '/output'); JArchive::extract(__DIR__ . '/logo-gz.png.gz', $this->outputPath); $this->assertFileExists($this->outputPath . '/logo-gz.png'); }
/** * Tests the extract Method. * * @group JArchive * @return void */ public function testExtract() { if (!JArchiveGzip::isSupported()) { $this->markTestSkipped('Gzip files can not be extracted.'); return; } $this->object->extract(__DIR__ . '/logo.gz', self::$outputPath . '/logo-gz.png'); $this->assertTrue(is_file(self::$outputPath . '/logo-gz.png')); if (is_file(self::$outputPath . '/logo-gz.png')) { unlink(self::$outputPath . '/logo-gz.png'); } }
/** * Tests extracting gzip. * * @return void */ public function testExtractGzip() { if (!is_dir(static::$outputPath)) { $this->markTestSkipped("Couldn't create folder."); return; } if (!is_writable(static::$outputPath) || !is_writable(JFactory::getConfig()->get('tmp_path'))) { $this->markTestSkipped("Folder not writable."); return; } if (!JArchiveGzip::isSupported()) { $this->markTestSkipped('Gzip files can not be extracted.'); return; } JArchive::extract(__DIR__ . '/logo.gz', static::$outputPath . '/logo-gz.png'); $this->assertTrue(is_file(static::$outputPath . '/logo-gz.png')); if (is_file(static::$outputPath . '/logo-gz.png')) { unlink(static::$outputPath . '/logo-gz.png'); } }
/** * Tests the isSupported Method. * * @return void */ public function testIsSupported() { $this->assertEquals(extension_loaded('zlib'), JArchiveGzip::isSupported()); }