# wp-optimize/3.2.5/vendor/kriswallsmith/assetic/tests/Assetic/Test/TestCase.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 3.2.5. 31 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/kriswallsmith/assetic/tests/Assetic/Test/TestCase.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/3.2.5/raw/vendor/kriswallsmith/assetic/tests/Assetic/Test/TestCase.php
- Modified: 2022-06-03T18:20:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/kriswallsmith/assetic/tests/Assetic/Test/TestCase.php#L10-L20`.

```php
<?php

namespace Assetic\Test;

abstract class TestCase extends \PHPUnit_Framework_TestCase
{
    protected static function removeDirectory($dir)
    {
        $inner = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS);
        $outer = new \RecursiveIteratorIterator($inner, \RecursiveIteratorIterator::SELF_FIRST);

        // remove the files first
        foreach ($outer as $file) {
            if ($file->isFile()) {
                unlink($file);
            }
        }

        // remove the sub-directories next
        $files = iterator_to_array($outer);
        foreach (array_reverse($files) as $file) {
            if ($file->isDir()) {
                rmdir($file);
            }
        }

        // finally the directory itself
        rmdir($dir);
    }
}

```
