1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Integration; |
||
6 | |||
7 | use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\ProjectRoot; |
||
8 | |||
9 | trait TestDirectoryTrait |
||
10 | { |
||
11 | private function createTestDirectory(): void |
||
12 | { |
||
13 | $dateTimeFolderName = date('Ymd_His'); |
||
14 | $random = random_int(10000, 99999); |
||
15 | $testDirectory = __DIR__."/../scratchpad/{$dateTimeFolderName}{$random}"; |
||
16 | $this->fileSystem->mkdir($testDirectory); |
||
17 | $cwd = getcwd(); |
||
18 | $this->assertNotFalse($cwd); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
19 | $this->projectRoot = ProjectRoot::fromProjectRoot($testDirectory, $cwd); |
||
0 ignored issues
–
show
|
|||
20 | } |
||
21 | |||
22 | private function removeTestDirectory(): void |
||
23 | { |
||
24 | $this->fileSystem->remove((string) $this->projectRoot); |
||
25 | } |
||
26 | } |
||
27 |