Example #1
0
 function testZipArchive()
 {
     $Compressor = new ZipArchive();
     $Compressor->AddFile(__FILE__);
     $Compressor->AddFile(dirname(__FILE__) . '/class.ZipArchive.php');
     $result = $Compressor->Pack();
     $this->assertTrue($result, "Archived successfully created");
     $content = $Compressor->GetArchive();
     $this->assertTrue(trim($content), "Archived successfully gotten");
     file_put_contents("/tmp/archive.zip", $content);
     chmod("/tmp/archive.zip", 0777);
 }