Skip to content

Commit

Permalink
fix #609: added support for 'phpunit.dusk.xml.dist'
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed Feb 13, 2019
1 parent 590480a commit cbb851b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Console/DuskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit cbb851b

Please sign in to comment.