From 96ff1c5014bce98a3e0428bc4b0fb36bb486e568 Mon Sep 17 00:00:00 2001 From: Adrian Dragus Date: Tue, 21 Apr 2015 01:15:28 +0100 Subject: [PATCH 1/2] Use PHPUnit pre-conditions See https://phpunit.de/manual/current/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.requires.tables.api --- tests/Composer/Test/Util/FilesystemTest.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/Composer/Test/Util/FilesystemTest.php b/tests/Composer/Test/Util/FilesystemTest.php index 8fc3a3642..00b746d60 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/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() { @@ -207,6 +208,7 @@ class FilesystemTest extends TestCase /** * @link https://github.com/composer/composer/issues/3144 + * @requires function symlink */ public function testRemoveSymlinkedDirectoryWithTrailingSlash() { @@ -239,11 +241,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'); - } - } } From 7834dacb885c5baedc7e4a1cd26ced39276cd0d0 Mon Sep 17 00:00:00 2001 From: Adrian Dragus Date: Tue, 21 Apr 2015 01:26:09 +0100 Subject: [PATCH 2/2] Forgot to remove the actual calls --- tests/Composer/Test/Util/FilesystemTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Composer/Test/Util/FilesystemTest.php b/tests/Composer/Test/Util/FilesystemTest.php index 00b746d60..8c86c7896 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/tests/Composer/Test/Util/FilesystemTest.php @@ -189,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) { @@ -219,7 +218,6 @@ class FilesystemTest extends TestCase $symlinked = $basepath . "/linked"; $symlinkedTrailingSlash = $symlinked . "/"; - $this->skipTestIfSymlinkPhpFunctionIsMissing(); $result = @symlink($basepath . "/real", $symlinked); if (!$result) {