Permalink
Browse files

* write in 'system temp dir'

 * update test case (oh look, a duplicate regex)
  • Loading branch information...
1 parent 21646d3 commit 176cd58435d254af3887b35c721d6594f9306e86 @till committed Jun 15, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 tests/Composer/Test/Package/Dumper/ZipDumperTest.php
@@ -26,12 +26,18 @@ public function testThis()
$package->setSourceReference('0.5.0');
$package->setSourceType('git');
- $zip = new ZipDumper('/tmp');
+ $temp = sys_get_temp_dir();
+
+ $zip = new ZipDumper($temp);
$zip->dump($package);
- $dist = sprintf('/%s-%s.zip', $package->getName(), $package->getVersion());
+ $name = preg_replace('#[^a-z0-9_-]#', '-', $package->getUniqueName());
- $this->assertFileExists(getcwd() . $dist);
+ $dist = sprintf('%s/%s.zip',
+ $temp, $name
+ );
+ $this->assertFileExists($dist);
+ unlink($dist);
}
/**

0 comments on commit 176cd58

Please sign in to comment.