@@ -17,7 +17,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase
17
17
{
18
18
private $ umask ;
19
19
20
- static protected $ longPathNamesWindows = array ();
20
+ protected $ longPathNamesWindows = array ();
21
21
22
22
/**
23
23
* @var \Symfony\Component\Filesystem\Filesystem
@@ -33,12 +33,6 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase
33
33
34
34
public static function setUpBeforeClass ()
35
35
{
36
- if (!empty (self ::$ longPathNamesWindows )) {
37
- foreach (self ::$ longPathNamesWindows as $ path ) {
38
- exec ('DEL ' .$ path );
39
- }
40
- }
41
-
42
36
if ('\\' === DIRECTORY_SEPARATOR && null === self ::$ symlinkOnWindows ) {
43
37
$ target = tempnam (sys_get_temp_dir (), 'sl ' );
44
38
$ link = sys_get_temp_dir ().'/sl ' .microtime (true ).mt_rand ();
@@ -52,14 +46,21 @@ public static function setUpBeforeClass()
52
46
protected function setUp ()
53
47
{
54
48
$ this ->umask = umask (0 );
49
+ $ this ->filesystem = new Filesystem ();
55
50
$ this ->workspace = rtrim (sys_get_temp_dir (), DIRECTORY_SEPARATOR ).DIRECTORY_SEPARATOR .time ().mt_rand (0 , 1000 );
56
51
mkdir ($ this ->workspace , 0777 , true );
57
52
$ this ->workspace = realpath ($ this ->workspace );
58
- $ this ->filesystem = new Filesystem ();
59
53
}
60
54
61
55
protected function tearDown ()
62
56
{
57
+ if (!empty ($ this ->longPathNamesWindows )) {
58
+ foreach ($ this ->longPathNamesWindows as $ path ) {
59
+ exec ('DEL ' .$ path );
60
+ }
61
+ $ this ->longPathNamesWindows = array ();
62
+ }
63
+
63
64
$ this ->filesystem ->remove ($ this ->workspace );
64
65
umask ($ this ->umask );
65
66
}
@@ -102,10 +103,6 @@ protected function getFileGroup($filepath)
102
103
103
104
protected function markAsSkippedIfSymlinkIsMissing ($ relative = false )
104
105
{
105
- if (!function_exists ('symlink ' )) {
106
- $ this ->markTestSkipped ('Function symlink is required. ' );
107
- }
108
-
109
106
if ('\\' === DIRECTORY_SEPARATOR && false === self ::$ symlinkOnWindows ) {
110
107
$ this ->markTestSkipped ('symlink requires "Create symbolic links" privilege on Windows ' );
111
108
}
0 commit comments