From cbb851bcbfabd42d90134e06f1b27a6e6f7613e9 Mon Sep 17 00:00:00 2001 From: Paul Klimov Date: Wed, 13 Feb 2019 19:01:01 +0200 Subject: [PATCH] fix #609: added support for 'phpunit.dusk.xml.dist' --- src/Console/DuskCommand.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index c3e6402a2..f45fe826f 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -100,7 +100,11 @@ protected function phpunitArguments($options) return ! Str::startsWith($option, '--env='); })); - return array_merge(['-c', base_path('phpunit.dusk.xml')], $options); + if (! file_exists($file = base_path('phpunit.dusk.xml'))) { + $file = base_path('phpunit.dusk.xml.dist'); + } + + return array_merge(['-c', $file], $options); } /** @@ -216,10 +220,13 @@ protected function refreshEnvironment() protected function writeConfiguration() { if (! file_exists($file = base_path('phpunit.dusk.xml'))) { - copy(realpath(__DIR__.'/../../stubs/phpunit.xml'), $file); - } else { - $this->hasPhpUnitConfiguration = true; + if (! file_exists(base_path('phpunit.dusk.xml.dist'))) { + copy(realpath(__DIR__.'/../../stubs/phpunit.xml'), $file); + return; + } } + + $this->hasPhpUnitConfiguration = true; } /**