Browse Source

Fix cache tests

Jordi Boggiano 6 years ago
parent
commit
936933fa66
1 changed files with 6 additions and 6 deletions
  1. 6 6
      tests/Composer/Test/CacheTest.php

+ 6 - 6
tests/Composer/Test/CacheTest.php

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