jonnybarnes.uk/tests/TestCase.php

20 lines
445 B
PHP
Raw Normal View History

2016-05-19 15:01:28 +01:00
<?php
namespace Tests;
2016-05-19 15:01:28 +01:00
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
2016-05-19 15:01:28 +01:00
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
public function removeDirIfEmpty(string $dir): void
{
// scandir() will always return `.` and `..` so even an “empty”
// directory will have a count of 2
if (is_dir($dir) && count(scandir($dir)) === 2) {
rmdir($dir);
}
}
2016-05-19 15:01:28 +01:00
}