public function testZipArchive() { // Set up repository $this->setupDummyRepo(); $package = $this->setupPackage(); $target = sys_get_temp_dir() . '/composer_archiver_test.zip'; // Test archive $archiver = new ZipArchiver(); $archiver->archive($package->getSourceUrl(), $target, 'zip'); $this->assertFileExists($target); unlink($target); }
public function testZipArchive() { if (!class_exists('ZipArchive')) { $this->markTestSkipped('Cannot run ZipArchiverTest, missing class "ZipArchive".'); } // Set up repository $this->setupDummyRepo(); $package = $this->setupPackage(); $target = sys_get_temp_dir() . '/composer_archiver_test.zip'; // Test archive $archiver = new ZipArchiver(); $archiver->archive($package->getSourceUrl(), $target, 'zip'); $this->assertFileExists($target); unlink($target); }