Browse Source

Merge pull request #3956 from nevvermind/use-phpunit-preconditions

Use PHPUnit pre-conditions
Jordi Boggiano 10 years ago
parent
commit
d93406a668
1 changed files with 2 additions and 9 deletions
  1. 2 9
      tests/Composer/Test/Util/FilesystemTest.php

+ 2 - 9
tests/Composer/Test/Util/FilesystemTest.php

@@ -179,6 +179,7 @@ class FilesystemTest extends TestCase
 
     /**
      * @link https://github.com/composer/composer/issues/3157
+     * @requires function symlink
      */
     public function testUnlinkSymlinkedDirectory()
     {
@@ -188,7 +189,6 @@ class FilesystemTest extends TestCase
         @mkdir($basepath . "/real", 0777, true);
         touch($basepath . "/real/FILE");
 
-        $this->skipTestIfSymlinkPhpFunctionIsMissing();
         $result = @symlink($basepath . "/real", $symlinked);
 
         if (!$result) {
@@ -207,6 +207,7 @@ class FilesystemTest extends TestCase
 
     /**
      * @link https://github.com/composer/composer/issues/3144
+     * @requires function symlink
      */
     public function testRemoveSymlinkedDirectoryWithTrailingSlash()
     {
@@ -217,7 +218,6 @@ class FilesystemTest extends TestCase
         $symlinked              = $basepath . "/linked";
         $symlinkedTrailingSlash = $symlinked . "/";
 
-        $this->skipTestIfSymlinkPhpFunctionIsMissing();
         $result = @symlink($basepath . "/real", $symlinked);
 
         if (!$result) {
@@ -239,11 +239,4 @@ class FilesystemTest extends TestCase
         $this->assertFalse(file_exists($symlinkedTrailingSlash));
         $this->assertFalse(file_exists($symlinked));
     }
-
-    private function skipTestIfSymlinkPhpFunctionIsMissing()
-    {
-        if (!function_exists('symlink')) {
-            $this->markTestSkipped('The php symlink() function for symbolic links is not available on this platform');
-        }
-    }
 }