ZipArchiverTest.php 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test\Package\Archiver;
  12. use Composer\Package\Archiver\ZipArchiver;
  13. class ZipArchiverTest extends ArchiverTest
  14. {
  15. public function testThis()
  16. {
  17. $this->setupGitRepo();
  18. $package = $this->setupPackage();
  19. $name = $this->getPackageFileName($package);
  20. $temp = sys_get_temp_dir();
  21. $zip = new ZipArchiver($temp);
  22. $zip->dump($package);
  23. $dist = sprintf('%s/%s.zip',
  24. $temp, $name
  25. );
  26. $this->assertFileExists($dist);
  27. unlink($dist);
  28. $this->removeGitRepo();
  29. }
  30. /**
  31. * @expectedException \InvalidArgumentException
  32. */
  33. public function testException()
  34. {
  35. new ZipArchiver("/totally-random-" . time());
  36. }
  37. }