Skip to content

Commit 4c39736

Browse files
authored
Merge pull request #51 from f-pisani/use-sys-temp-dir-instead-of-mkdir
Use sys_temp_dir() instead of mkdir in UploadedFileIntegrationTest
2 parents dbc81e5 + 821c7af commit 4c39736

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/UploadedFileIntegrationTest.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ abstract class UploadedFileIntegrationTest extends BaseTest
2525
*/
2626
abstract public function createSubject();
2727

28-
public static function setUpBeforeClass(): void
29-
{
30-
@mkdir('.tmp');
31-
parent::setUpBeforeClass();
32-
}
33-
3428
protected function setUp(): void
3529
{
3630
$this->uploadedFile = $this->createSubject();
@@ -56,7 +50,7 @@ public function testGetStreamAfterMoveTo()
5650

5751
$file = $this->createSubject();
5852
$this->expectException(\RuntimeException::class);
59-
$file->moveTo(sys_get_temp_dir().'/foo');
53+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
6054
$file->getStream();
6155
}
6256

@@ -81,7 +75,7 @@ public function testMoveToRelative()
8175
}
8276

8377
$file = $this->createSubject();
84-
$targetPath = '.tmp/'.uniqid('foo', true);
78+
$targetPath = sys_get_temp_dir().'/'.uniqid('foo', true);
8579

8680
$this->assertFalse(is_file($targetPath));
8781
$file->moveTo($targetPath);
@@ -96,8 +90,8 @@ public function testMoveToTwice()
9690
$this->expectException(\RuntimeException::class);
9791

9892
$file = $this->createSubject();
99-
$file->moveTo('.tmp/'.uniqid('foo', true));
100-
$file->moveTo('.tmp/'.uniqid('foo', true));
93+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
94+
$file->moveTo(sys_get_temp_dir().'/'.uniqid('foo', true));
10195
}
10296

10397
public function testGetSize()

0 commit comments

Comments
 (0)