|
@@ -13,6 +13,7 @@
|
|
|
namespace Composer\Test;
|
|
|
|
|
|
use Composer\Test\TestCase;
|
|
|
+use Composer\Cache;
|
|
|
use Composer\Util\Filesystem;
|
|
|
|
|
|
class CacheTest extends TestCase
|
|
@@ -40,7 +41,7 @@ class CacheTest extends TestCase
|
|
|
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
|
|
$this->cache = $this->getMockBuilder('Composer\Cache')
|
|
|
->setMethods(array('getFinder'))
|
|
|
- ->setConstructorArgs(array($io, $this->root, 'a-z0-9.', $this->filesystem))
|
|
|
+ ->setConstructorArgs(array($io, $this->root))
|
|
|
->getMock();
|
|
|
$this->cache
|
|
|
->expects($this->any())
|
|
@@ -109,13 +110,12 @@ class CacheTest extends TestCase
|
|
|
{
|
|
|
$this->filesystem
|
|
|
->method('removeDirectory')
|
|
|
- ->with($this->root)
|
|
|
+ ->with($this->root.'/')
|
|
|
->willReturn(true);
|
|
|
|
|
|
- $this->assertTrue($this->cache->clear());
|
|
|
+ $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
|
|
+ $this->cache = new Cache($io, $this->root, 'a-z0-9.', $this->filesystem);
|
|
|
|
|
|
- for ($i = 0; $i < 3; $i++) {
|
|
|
- $this->assertFileNotExists("{$this->root}/cached.file{$i}.zip");
|
|
|
- }
|
|
|
+ $this->assertTrue($this->cache->clear());
|
|
|
}
|
|
|
}
|