1
0
Fork 0

Fix cache tests

pull/7995/head
Jordi Boggiano 2019-02-18 14:12:01 +01:00
parent 0caa616e6c
commit 936933fa66
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 6 deletions

View File

@ -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");
}
} }
} }