gitignore, product photos fixture, copy/delete in base controller test setUp/tearDown
This commit is contained in:
@@ -58,14 +58,7 @@ class ProductPhotosControllerTest extends BaseControllerTest
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->ProductPhotos);
|
||||
$path = Configure::readOrFail('CakeProducts.photos.directory');
|
||||
if (file_exists($path)) {
|
||||
$di = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
|
||||
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ( $ri as $file ) {
|
||||
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user