Ejemplo n.º 1
0
 /**
  * Tests extracting ZIP.
  *
  * @return  void
  */
 public function testExtractZip()
 {
     if (!JArchiveZip::isSupported()) {
         $this->markTestSkipped('ZIP files can not be extracted.');
     }
     JArchive::extract(__DIR__ . '/logo.zip', $this->outputPath);
     $this->assertFileExists($this->outputPath . '/logo-zip.png');
 }
Ejemplo n.º 2
0
 /**
  * Tests the extract Method.
  *
  * @group   JArchive
  * @return  void
  */
 public function testExtract()
 {
     if (!JArchiveZip::isSupported()) {
         $this->markTestSkipped('ZIP files can not be extracted.');
         return;
     }
     $this->object->extract(__DIR__ . '/logo.zip', self::$outputPath);
     $this->assertTrue(is_file(self::$outputPath . '/logo-zip.png'));
     if (is_file(self::$outputPath . '/logo-zip.png')) {
         unlink(self::$outputPath . '/logo-zip.png');
     }
 }
Ejemplo n.º 3
0
 /**
  * Tests extracting ZIP.
  *
  * @group    JArchive
  * @covers    JArchive::extract
  * @return  void
  */
 public function testExtractZip()
 {
     if (!is_dir(self::$outputPath)) {
         $this->markTestSkipped("Couldn't create folder.");
         return;
     }
     if (!JArchiveZip::isSupported()) {
         $this->markTestSkipped('ZIP files can not be extracted.');
         return;
     }
     JArchive::extract(__DIR__ . '/logo.zip', self::$outputPath);
     $this->assertTrue(is_file(self::$outputPath . '/logo-zip.png'));
     if (is_file(self::$outputPath . '/logo-zip.png')) {
         unlink(self::$outputPath . '/logo-zip.png');
     }
 }
Ejemplo n.º 4
0
	/**
	 * Tests the isSupported Method.
	 *
	 * @group    JArchive
	 * @return   void
	 *
	 * @covers   JArchiveGzip::isSupported
	 * @depends  testHasNativeSupport
	 */
	public function testIsSupported()
	{
		$this->assertEquals(
			(JArchiveZip::hasNativeSupport() || extension_loaded('zlib')),
			JArchiveZip::isSupported()
		);
	}