2016-05-19 15:01:28 +01:00
|
|
|
<?php
|
|
|
|
|
2017-02-18 12:27:21 +00:00
|
|
|
namespace Tests;
|
2016-05-19 15:01:28 +01:00
|
|
|
|
2017-02-18 12:27:21 +00:00
|
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
2016-05-19 15:01:28 +01:00
|
|
|
|
2017-02-18 12:27:21 +00:00
|
|
|
abstract class TestCase extends BaseTestCase
|
|
|
|
{
|
|
|
|
use CreatesApplication;
|
2024-10-25 20:40:52 +01:00
|
|
|
|
|
|
|
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
|
|
|
}
|