Improve code, fix filesystem test failing after first run
This commit is contained in:
@@ -6,11 +6,14 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class AbstractTestCase extends TestCase
|
||||
{
|
||||
public function getTmpDirectory()
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTmpDirectory(): string
|
||||
{
|
||||
$location = __DIR__ . '/../tmp';
|
||||
if (!file_exists($location)) {
|
||||
if (!mkdir($location)) {
|
||||
if (!mkdir($location) && !is_dir($location)) {
|
||||
throw new \RuntimeException('Could not create directory: ' . $location);
|
||||
}
|
||||
chmod($location, 0777);
|
||||
|
||||
Reference in New Issue
Block a user