From c4295b43794c4442d262905803f9136bbeae9821 Mon Sep 17 00:00:00 2001 From: Deleu Date: Mon, 13 Mar 2017 16:51:25 -0300 Subject: [PATCH] Purging console files before starting tests --- src/Console/DuskCommand.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index e3d4fc039..a4221cd29 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -51,6 +51,7 @@ public function __construct() public function handle() { $this->purgeScreenshots(); + $this->purgeConsole(); $options = array_slice($_SERVER['argv'], 2); @@ -103,6 +104,21 @@ protected function purgeScreenshots() } } + /** + * Purge console files + * + * @return void + */ + protected function purgeConsole() + { + $files = Finder::create()->files() + ->in(base_path('tests/Browser/console')) + ->name('*.log'); + + foreach ($files as $file) + @unlink($file->getRealPath()); + } + /** * Run the given callback with the Dusk configuration files. *