@@ -31,7 +31,7 @@ public function testLGCharEscaping()
3131 $ this ->assertEquals ("\\<info>some info \\</info> " , OutputFormatter::escape ('<info>some info</info> ' ));
3232
3333 $ this ->assertEquals (
34- "\033[33mSymfony \\Component \\Console does work very well! \033[0m " ,
34+ "\033[33mSymfony \\Component \\Console does work very well! \033[39m " ,
3535 $ formatter ->format ('<comment>Symfony\Component\Console does work very well!</comment> ' )
3636 );
3737 }
@@ -46,19 +46,19 @@ public function testBundledStyles()
4646 $ this ->assertTrue ($ formatter ->hasStyle ('question ' ));
4747
4848 $ this ->assertEquals (
49- "\033[37;41msome error \033[0m " ,
49+ "\033[37;41msome error \033[39;49m " ,
5050 $ formatter ->format ('<error>some error</error> ' )
5151 );
5252 $ this ->assertEquals (
53- "\033[32msome info \033[0m " ,
53+ "\033[32msome info \033[39m " ,
5454 $ formatter ->format ('<info>some info</info> ' )
5555 );
5656 $ this ->assertEquals (
57- "\033[33msome comment \033[0m " ,
57+ "\033[33msome comment \033[39m " ,
5858 $ formatter ->format ('<comment>some comment</comment> ' )
5959 );
6060 $ this ->assertEquals (
61- "\033[30;46msome question \033[0m " ,
61+ "\033[30;46msome question \033[39;49m " ,
6262 $ formatter ->format ('<question>some question</question> ' )
6363 );
6464 }
@@ -68,7 +68,7 @@ public function testNestedStyles()
6868 $ formatter = new OutputFormatter (true );
6969
7070 $ this ->assertEquals (
71- "\033[37;41msome \033[0m \033[32msome info \033[0m \033[37;41m error \033[0m " ,
71+ "\033[37;41msome \033[39;49m \033[32msome info \033[39m \033[37;41m error \033[39;49m " ,
7272 $ formatter ->format ('<error>some <info>some info</info> error</error> ' )
7373 );
7474 }
@@ -78,7 +78,7 @@ public function testAdjacentStyles()
7878 $ formatter = new OutputFormatter (true );
7979
8080 $ this ->assertEquals (
81- "\033[37;41msome error \033[0m \033[32msome info \033[0m " ,
81+ "\033[37;41msome error \033[39;49m \033[32msome info \033[39m " ,
8282 $ formatter ->format ('<error>some error</error><info>some info</info> ' )
8383 );
8484 }
@@ -88,7 +88,7 @@ public function testStyleMatchingNotGreedy()
8888 $ formatter = new OutputFormatter (true );
8989
9090 $ this ->assertEquals (
91- "( \033[32m>=2.0,<2.3 \033[0m ) " ,
91+ "( \033[32m>=2.0,<2.3 \033[39m ) " ,
9292 $ formatter ->format ('(<info>>=2.0,<2.3</info>) ' )
9393 );
9494 }
@@ -98,7 +98,7 @@ public function testStyleEscaping()
9898 $ formatter = new OutputFormatter (true );
9999
100100 $ this ->assertEquals (
101- "( \033[32mz>=2.0,<a2.3 \033[0m ) " ,
101+ "( \033[32mz>=2.0,<a2.3 \033[39m ) " ,
102102 $ formatter ->format ('(<info> ' .$ formatter ->escape ('z>=2.0,<a2.3 ' ).'</info>) ' )
103103 );
104104 }
@@ -108,7 +108,7 @@ public function testDeepNestedStyles()
108108 $ formatter = new OutputFormatter (true );
109109
110110 $ this ->assertEquals (
111- "\033[37;41merror \033[0m \033[32minfo \033[0m \033[33mcomment \033[0m \033[37;41merror \033[0m " ,
111+ "\033[37;41merror \033[39;49m \033[32minfo \033[39m \033[33mcomment \033[39m \033[37;41merror \033[39;49m " ,
112112 $ formatter ->format ('<error>error<info>info<comment>comment</info>error</error> ' )
113113 );
114114 }
@@ -126,7 +126,7 @@ public function testNewStyle()
126126 $ style = new OutputFormatterStyle ('blue ' , 'white ' );
127127 $ formatter ->setStyle ('b ' , $ style );
128128
129- $ this ->assertEquals ("\033[34;47msome \033[0m \033[34;47mcustom \033[0m \033[34;47m msg \033[0m " , $ formatter ->format ('<test>some <b>custom</b> msg</test> ' ));
129+ $ this ->assertEquals ("\033[34;47msome \033[39;49m \033[34;47mcustom \033[39;49m \033[34;47m msg \033[39;49m " , $ formatter ->format ('<test>some <b>custom</b> msg</test> ' ));
130130 }
131131
132132 public function testRedefineStyle ()
@@ -136,29 +136,29 @@ public function testRedefineStyle()
136136 $ style = new OutputFormatterStyle ('blue ' , 'white ' );
137137 $ formatter ->setStyle ('info ' , $ style );
138138
139- $ this ->assertEquals ("\033[34;47msome custom msg \033[0m " , $ formatter ->format ('<info>some custom msg</info> ' ));
139+ $ this ->assertEquals ("\033[34;47msome custom msg \033[39;49m " , $ formatter ->format ('<info>some custom msg</info> ' ));
140140 }
141141
142142 public function testInlineStyle ()
143143 {
144144 $ formatter = new OutputFormatter (true );
145145
146- $ this ->assertEquals ("\033[34;41msome text \033[0m " , $ formatter ->format ('<fg=blue;bg=red>some text</> ' ));
147- $ this ->assertEquals ("\033[34;41msome text \033[0m " , $ formatter ->format ('<fg=blue;bg=red>some text</fg=blue;bg=red> ' ));
146+ $ this ->assertEquals ("\033[34;41msome text \033[39;49m " , $ formatter ->format ('<fg=blue;bg=red>some text</> ' ));
147+ $ this ->assertEquals ("\033[34;41msome text \033[39;49m " , $ formatter ->format ('<fg=blue;bg=red>some text</fg=blue;bg=red> ' ));
148148 }
149149
150150 public function testNonStyleTag ()
151151 {
152152 $ formatter = new OutputFormatter (true );
153153
154- $ this ->assertEquals ("\033[32msome \033[0m \033[32m<tag> \033[0m \033[32m styled \033[0m \033[32m<p> \033[0m \033[32msingle-char tag \033[0m \033[32m</p> \033[0m " , $ formatter ->format ('<info>some <tag> styled <p>single-char tag</p></info> ' ));
154+ $ this ->assertEquals ("\033[32msome \033[39m \033[32m<tag> \033[39m \033[32m styled \033[39m \033[32m<p> \033[39m \033[32msingle-char tag \033[39m \033[32m</p> \033[39m " , $ formatter ->format ('<info>some <tag> styled <p>single-char tag</p></info> ' ));
155155 }
156156
157157 public function testFormatLongString ()
158158 {
159159 $ formatter = new OutputFormatter (true );
160160 $ long = str_repeat ("\\" , 14000 );
161- $ this ->assertEquals ("\033[37;41msome error \033[0m " .$ long , $ formatter ->format ('<error>some error</error> ' .$ long ));
161+ $ this ->assertEquals ("\033[37;41msome error \033[39;49m " .$ long , $ formatter ->format ('<error>some error</error> ' .$ long ));
162162 }
163163
164164 public function testNotDecoratedFormatter ()
@@ -186,16 +186,16 @@ public function testNotDecoratedFormatter()
186186 $ formatter ->setDecorated (true );
187187
188188 $ this ->assertEquals (
189- "\033[37;41msome error \033[0m " , $ formatter ->format ('<error>some error</error> ' )
189+ "\033[37;41msome error \033[39;49m " , $ formatter ->format ('<error>some error</error> ' )
190190 );
191191 $ this ->assertEquals (
192- "\033[32msome info \033[0m " , $ formatter ->format ('<info>some info</info> ' )
192+ "\033[32msome info \033[39m " , $ formatter ->format ('<info>some info</info> ' )
193193 );
194194 $ this ->assertEquals (
195- "\033[33msome comment \033[0m " , $ formatter ->format ('<comment>some comment</comment> ' )
195+ "\033[33msome comment \033[39m " , $ formatter ->format ('<comment>some comment</comment> ' )
196196 );
197197 $ this ->assertEquals (
198- "\033[30;46msome question \033[0m " , $ formatter ->format ('<question>some question</question> ' )
198+ "\033[30;46msome question \033[39;49m " , $ formatter ->format ('<question>some question</question> ' )
199199 );
200200 }
201201
@@ -205,7 +205,7 @@ public function testContentWithLineBreaks()
205205
206206 $ this ->assertEquals (<<<EOF
207207\033[32m
208- some text \033[0m
208+ some text \033[39m
209209EOF
210210 , $ formatter ->format (<<<EOF
211211<info>
@@ -215,7 +215,7 @@ public function testContentWithLineBreaks()
215215
216216 $ this ->assertEquals (<<<EOF
217217\033[32msome text
218- \033[0m
218+ \033[39m
219219EOF
220220 , $ formatter ->format (<<<EOF
221221<info>some text
@@ -226,7 +226,7 @@ public function testContentWithLineBreaks()
226226 $ this ->assertEquals (<<<EOF
227227\033[32m
228228some text
229- \033[0m
229+ \033[39m
230230EOF
231231 , $ formatter ->format (<<<EOF
232232<info>
@@ -239,7 +239,7 @@ public function testContentWithLineBreaks()
239239\033[32m
240240some text
241241more text
242- \033[0m
242+ \033[39m
243243EOF
244244 , $ formatter ->format (<<<EOF
245245<info>
0 commit comments