File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,17 @@ private function setMockIo(array $inputs): void
3737 User::setInputOutput ($ this ->io );
3838 }
3939
40+ private function getOutputWithoutColorCode (): string
41+ {
42+ $ output = str_replace (["\033[0;32m " , "\033[0m " ], '' , $ this ->io ->getOutputs ());
43+
44+ if (is_windows ()) {
45+ $ output = str_replace ("\r\n" , "\n" , $ output );
46+ }
47+
48+ return $ output ;
49+ }
50+
4051 public function testNoAction (): void
4152 {
4253 $ this ->setMockIo ([]);
@@ -466,7 +477,7 @@ public function testList(): void
4664771 user8 (user8@example.com)
4674782 user9 (user9@example.com)
468479 ' ,
469- $ this ->io -> getOutputs ()
480+ $ this ->getOutputWithoutColorCode ()
470481 );
471482 }
472483
@@ -491,7 +502,7 @@ public function testListByEmail(): void
491502 'Id User
4925032 user9 (user9@example.com)
493504 ' ,
494- $ this ->io -> getOutputs ()
505+ $ this ->getOutputWithoutColorCode ()
495506 );
496507 }
497508
You can’t perform that action at this time.
0 commit comments