コード例 #1
0
ファイル: tests.php プロジェクト: rakesh-mohanta/scalr
 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);
 }