We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 70b5c6e + 1125280 commit 6d3f0b7Copy full SHA for 6d3f0b7
test/BaseTest.php
@@ -4,6 +4,7 @@
4
5
namespace PhpSchool\PhpWorkshopTest;
6
7
+use PhpSchool\PhpWorkshop\Utils\Path;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\Filesystem\Filesystem;
10
@@ -23,6 +24,20 @@ public function getTemporaryDirectory(): string
23
24
return $this->tempDirectory;
25
}
26
27
+ public function getTemporaryFile(string $filename): string
28
+ {
29
+ $file = Path::join($this->getTemporaryDirectory(), $filename);
30
+
31
+ if (file_exists($file)) {
32
+ return $file;
33
+ }
34
35
+ @mkdir(dirname($file), 0777, true);
36
+ touch($file);
37
38
39
40
41
public function tearDown(): void
42
{
43
if ($this->tempDirectory) {
0 commit comments