Improve code, fix filesystem test failing after first run

This commit is contained in:
2018-03-25 12:48:54 +02:00
parent 5b94961691
commit d992c767e8
12 changed files with 68 additions and 43 deletions

View File

@@ -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);