Fix cache tests
parent
0caa616e6c
commit
936933fa66
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\Test;
|
namespace Composer\Test;
|
||||||
|
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
|
use Composer\Cache;
|
||||||
use Composer\Util\Filesystem;
|
use Composer\Util\Filesystem;
|
||||||
|
|
||||||
class CacheTest extends TestCase
|
class CacheTest extends TestCase
|
||||||
|
@ -40,7 +41,7 @@ class CacheTest extends TestCase
|
||||||
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
||||||
$this->cache = $this->getMockBuilder('Composer\Cache')
|
$this->cache = $this->getMockBuilder('Composer\Cache')
|
||||||
->setMethods(array('getFinder'))
|
->setMethods(array('getFinder'))
|
||||||
->setConstructorArgs(array($io, $this->root, 'a-z0-9.', $this->filesystem))
|
->setConstructorArgs(array($io, $this->root))
|
||||||
->getMock();
|
->getMock();
|
||||||
$this->cache
|
$this->cache
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
|
@ -109,13 +110,12 @@ class CacheTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->filesystem
|
$this->filesystem
|
||||||
->method('removeDirectory')
|
->method('removeDirectory')
|
||||||
->with($this->root)
|
->with($this->root.'/')
|
||||||
->willReturn(true);
|
->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->assertTrue($this->cache->clear());
|
||||||
$this->assertFileNotExists("{$this->root}/cached.file{$i}.zip");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue