1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Cache: clear cache using removeDirectory

This commit is contained in:
Brandon Max 2017-05-31 22:02:15 -04:00
parent 27ee47def7
commit 24b8fea48a
3 changed files with 27 additions and 4 deletions

View file

@ -107,4 +107,18 @@ class CacheTest extends TestCase
}
$this->assertFileExists("{$this->root}/cached.file3.zip");
}
public function testClearCache()
{
$this->finder
->method('removeDirectory')
->with($this->root)
->willReturn(true);
$this->assertTrue($this->cache->clear());
for ($i = 0; $i < 3; $i++) {
$this->assertFileNotExists("{$this->root}/cached.file{$i}.zip");
}
}
}