protected function tearDown() { TempFileUtil::removeTempFiles(); if ($this->tempFolder !== null && is_dir($this->tempFolder)) { rmdir($this->tempFolder); } }
/** * {@inheritDoc} */ public function boot() { /* * Removes all temporary files created while handling file uploads. * Use a shutdown function to clean up even in case of a fatal error. */ register_shutdown_function(function () { TempFileUtil::removeTempFiles(); }); }