Explorar el Código

SCA: revert assertions tweaks

Vladimir Reznichenko hace 7 años
padre
commit
db0cae0477
Se han modificado 1 ficheros con 8 adiciones y 8 borrados
  1. 8 8
      tests/Composer/Test/Util/FilesystemTest.php

+ 8 - 8
tests/Composer/Test/Util/FilesystemTest.php

@@ -307,9 +307,9 @@ class FilesystemTest extends TestCase
         $this->assertTrue($fs->isJunction($junction . '/../junction'));
 
         // Remove junction
-        $this->assertDirectoryExists($junction);
+        $this->assertTrue(is_dir($junction));
         $this->assertTrue($fs->removeJunction($junction));
-        $this->assertDirectoryNotExists($junction);
+        $this->assertFalse(is_dir($junction));
     }
 
     public function testCopy()
@@ -325,9 +325,9 @@ class FilesystemTest extends TestCase
 
         $result1 = $fs->copy($this->workingDir . '/foo', $this->workingDir . '/foop');
         $this->assertTrue($result1, 'Copying directory failed.');
-        $this->assertDirectoryExists($this->workingDir . '/foop', 'Not a directory: ' . $this->workingDir . '/foop');
-        $this->assertDirectoryExists($this->workingDir . '/foop/bar', 'Not a directory: ' . $this->workingDir . '/foop/bar');
-        $this->assertDirectoryExists($this->workingDir . '/foop/baz', 'Not a directory: ' . $this->workingDir . '/foop/baz');
+        $this->assertTrue(is_dir($this->workingDir . '/foop'), 'Not a directory: ' . $this->workingDir . '/foop');
+        $this->assertTrue(is_dir($this->workingDir . '/foop/bar'), 'Not a directory: ' . $this->workingDir . '/foop/bar');
+        $this->assertTrue(is_dir($this->workingDir . '/foop/baz'), 'Not a directory: ' . $this->workingDir . '/foop/baz');
         $this->assertTrue(is_file($this->workingDir . '/foop/foo.file'), 'Not a file: ' . $this->workingDir . '/foop/foo.file');
         $this->assertTrue(is_file($this->workingDir . '/foop/bar/foobar.file'), 'Not a file: ' . $this->workingDir . '/foop/bar/foobar.file');
         $this->assertTrue(is_file($this->workingDir . '/foop/baz/foobaz.file'), 'Not a file: ' . $this->workingDir . '/foop/baz/foobaz.file');
@@ -355,8 +355,8 @@ class FilesystemTest extends TestCase
         $this->assertFalse(is_file($this->workingDir . '/foo/baz/foobaz.file'), 'Still a file: ' . $this->workingDir . '/foo/baz/foobaz.file');
         $this->assertFalse(is_file($this->workingDir . '/foo/bar/foobar.file'), 'Still a file: ' . $this->workingDir . '/foo/bar/foobar.file');
         $this->assertFalse(is_file($this->workingDir . '/foo/foo.file'), 'Still a file: ' . $this->workingDir . '/foo/foo.file');
-        $this->assertDirectoryNotExists($this->workingDir . '/foo/baz', 'Still a directory: ' . $this->workingDir . '/foo/baz');
-        $this->assertDirectoryNotExists($this->workingDir . '/foo/bar', 'Still a directory: ' . $this->workingDir . '/foo/bar');
-        $this->assertDirectoryNotExists($this->workingDir . '/foo', 'Still a directory: ' . $this->workingDir . '/foo');
+        $this->assertFalse(is_dir($this->workingDir . '/foo/baz'), 'Still a directory: ' . $this->workingDir . '/foo/baz');
+        $this->assertFalse(is_dir($this->workingDir . '/foo/bar'), 'Still a directory: ' . $this->workingDir . '/foo/bar');
+        $this->assertFalse(is_dir($this->workingDir . '/foo'), 'Still a directory: ' . $this->workingDir . '/foo');
     }
 }