From ce0d197ea5c3fcccb1eeafed8333b6a910d7295a Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Sat, 14 Oct 2023 10:18:13 +0800 Subject: [PATCH] Fixes unknown option "--ansi" and "--no-ansi" fixes #1066 Signed-off-by: Mior Muhammad Zaki --- src/Console/DuskCommand.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index 0701b2367..3e46d5660 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -125,13 +125,21 @@ protected function phpunitArguments($options) } $options = array_values(array_filter($options, function ($option) { - return ! Str::startsWith($option, ['--env=', '--pest']); + return ! Str::startsWith($option, ['--env=', '--pest', '--ansi', '--no-ansi']); })); if (! file_exists($file = base_path('phpunit.dusk.xml'))) { $file = base_path('phpunit.dusk.xml.dist'); } + if ($this->option('ansi')) { + $options[] = '--colors="always"'; + } + + if ($this->option('no-ansi')) { + $options[] = '--colors="never"'; + } + return array_merge(['-c', $file], $options); }