diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bb28c109..46128987 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -25,6 +25,9 @@ ./app + + + diff --git a/tests/TestListener.php b/tests/TestListener.php new file mode 100644 index 00000000..b92cfb5b --- /dev/null +++ b/tests/TestListener.php @@ -0,0 +1,41 @@ + + */ +class TestListener extends PHPUnit_Framework_BaseTestListener +{ + /** + * A test suite ended. + * + * @param \PHPUnit_Framework_TestSuite $suite + * + * @return void + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + if ($suite->getName() !== 'Cachet Test Suite') { + return; + } + + foreach (glob(__DIR__.'/../bootstrap/cache{,t}/*.php', GLOB_BRACE) as $file) { + unlink($file); + } + } +}