File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/Symfony/Component/Console Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ public function getStyle($name)
142
142
*/
143
143
public function format ($ message )
144
144
{
145
+ $ message = (string ) $ message ;
145
146
$ offset = 0 ;
146
147
$ output = '' ;
147
148
$ tagRegex = '[a-z][a-z0-9_=;-]* ' ;
Original file line number Diff line number Diff line change @@ -166,6 +166,14 @@ public function testFormatLongString()
166
166
$ this ->assertEquals ("\033[37;41msome error \033[0m " .$ long , $ formatter ->format ('<error>some error</error> ' .$ long ));
167
167
}
168
168
169
+ public function testFormatToStringObject ()
170
+ {
171
+ $ formatter = new OutputFormatter (false );
172
+ $ this ->assertEquals (
173
+ 'some info ' , $ formatter ->format (new TableCell ())
174
+ );
175
+ }
176
+
169
177
public function testNotDecoratedFormatter ()
170
178
{
171
179
$ formatter = new OutputFormatter (false );
@@ -255,3 +263,11 @@ public function testContentWithLineBreaks()
255
263
));
256
264
}
257
265
}
266
+
267
+ class TableCell
268
+ {
269
+ public function __toString ()
270
+ {
271
+ return '<info>some info</info> ' ;
272
+ }
273
+ }
You can’t perform that action at this time.
0 commit comments