Skip to content

Commit af4fd6a

Browse files
author
Florian Pisani
committed
Use sys_get_temp_dir() rather than mkdir for temporary files
1 parent dbc81e5 commit af4fd6a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/UploadedFileIntegrationTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ abstract public function createSubject();
2727

2828
public static function setUpBeforeClass(): void
2929
{
30-
@mkdir('.tmp');
3130
parent::setUpBeforeClass();
3231
}
3332

@@ -56,7 +55,7 @@ public function testGetStreamAfterMoveTo()
5655

5756
$file = $this->createSubject();
5857
$this->expectException(\RuntimeException::class);
59-
$file->moveTo(sys_get_temp_dir().'/foo');
58+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
6059
$file->getStream();
6160
}
6261

@@ -81,7 +80,7 @@ public function testMoveToRelative()
8180
}
8281

8382
$file = $this->createSubject();
84-
$targetPath = '.tmp/'.uniqid('foo', true);
83+
$targetPath = sys_get_temp_dir().'/'.uniqid('foo', true);
8584

8685
$this->assertFalse(is_file($targetPath));
8786
$file->moveTo($targetPath);
@@ -96,8 +95,8 @@ public function testMoveToTwice()
9695
$this->expectException(\RuntimeException::class);
9796

9897
$file = $this->createSubject();
99-
$file->moveTo('.tmp/'.uniqid('foo', true));
100-
$file->moveTo('.tmp/'.uniqid('foo', true));
98+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
99+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
101100
}
102101

103102
public function testGetSize()

0 commit comments

Comments
 (0)