@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | |
100 | 100 | $this->assertEquals( |
101 | 101 | "(\033[32mz>=2.0,<a2.3\033[39m)", |
102 | - $formatter->format('(<info>'.$formatter->escape('z>=2.0,<a2.3').'</info>)') |
|
102 | + $formatter->format('(<info>' . $formatter->escape('z>=2.0,<a2.3') . '</info>)') |
|
103 | 103 | ); |
104 | 104 | |
105 | 105 | $this->assertEquals( |
106 | 106 | "\033[32m<error>some error</error>\033[39m", |
107 | - $formatter->format('<info>'.$formatter->escape('<error>some error</error>').'</info>') |
|
107 | + $formatter->format('<info>' . $formatter->escape('<error>some error</error>') . '</info>') |
|
108 | 108 | ); |
109 | 109 | } |
110 | 110 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $formatter = new OutputFormatter(true); |
165 | 165 | $long = str_repeat("\\", 14000); |
166 | - $this->assertEquals("\033[37;41msome error\033[39;49m".$long, $formatter->format('<error>some error</error>'.$long)); |
|
166 | + $this->assertEquals("\033[37;41msome error\033[39;49m" . $long, $formatter->format('<error>some error</error>' . $long)); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | public function testNotDecoratedFormatter() |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | ); |
38 | 38 | |
39 | 39 | $this->assertEquals( |
40 | - '<error> Some text to display </error>'."\n". |
|
40 | + '<error> Some text to display </error>' . "\n" . |
|
41 | 41 | '<error> foo bar </error>', |
42 | 42 | $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'), |
43 | 43 | '::formatBlock() formats a message in a block' |
44 | 44 | ); |
45 | 45 | |
46 | 46 | $this->assertEquals( |
47 | - '<error> </error>'."\n". |
|
48 | - '<error> Some text to display </error>'."\n". |
|
47 | + '<error> </error>' . "\n" . |
|
48 | + '<error> Some text to display </error>' . "\n" . |
|
49 | 49 | '<error> </error>', |
50 | 50 | $formatter->formatBlock('Some text to display', 'error', true), |
51 | 51 | '::formatBlock() formats a message in a block' |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $formatter = new FormatterHelper(); |
62 | 62 | |
63 | 63 | $this->assertEquals( |
64 | - '<error> </error>'."\n". |
|
65 | - '<error> Du texte à afficher </error>'."\n". |
|
64 | + '<error> </error>' . "\n" . |
|
65 | + '<error> Du texte à afficher </error>' . "\n" . |
|
66 | 66 | '<error> </error>', |
67 | 67 | $formatter->formatBlock('Du texte à afficher', 'error', true), |
68 | 68 | '::formatBlock() formats a message in a block' |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | $formatter = new FormatterHelper(); |
78 | 78 | $this->assertEquals( |
79 | - '<error> </error>'."\n". |
|
80 | - '<error> 表示するテキスト </error>'."\n". |
|
79 | + '<error> </error>' . "\n" . |
|
80 | + '<error> 表示するテキスト </error>' . "\n" . |
|
81 | 81 | '<error> </error>', |
82 | 82 | $formatter->formatBlock('表示するテキスト', 'error', true), |
83 | 83 | '::formatBlock() formats a message in a block' |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $formatter = new FormatterHelper(); |
90 | 90 | |
91 | 91 | $this->assertEquals( |
92 | - '<error> </error>'."\n". |
|
93 | - '<error> \<info>some info\</info> </error>'."\n". |
|
92 | + '<error> </error>' . "\n" . |
|
93 | + '<error> \<info>some info\</info> </error>' . "\n" . |
|
94 | 94 | '<error> </error>', |
95 | 95 | $formatter->formatBlock('<info>some info</info>', 'error', true), |
96 | 96 | '::formatBlock() escapes \'<\' chars' |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $progress->advance(2); |
53 | 53 | |
54 | 54 | rewind($output->getStream()); |
55 | - $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); |
|
55 | + $this->assertEquals($this->generateOutput(' 3 [--->------------------------]') . $this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function testCustomizations() |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $progress->advance(); |
80 | 80 | |
81 | 81 | rewind($output->getStream()); |
82 | - $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream())); |
|
82 | + $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%') . $this->generateOutput(' 1/50 [>---------------------------] 2%') . $this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream())); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | public function testOverwriteWithShorterLine() |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | |
97 | 97 | rewind($output->getStream()); |
98 | 98 | $this->assertEquals( |
99 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
100 | - $this->generateOutput(' 1/50 [>---------------------------] 2%'). |
|
99 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
100 | + $this->generateOutput(' 1/50 [>---------------------------] 2%') . |
|
101 | 101 | $this->generateOutput(' 2/50 [=>--------------------------] '), |
102 | 102 | stream_get_contents($output->getStream()) |
103 | 103 | ); |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | |
115 | 115 | rewind($output->getStream()); |
116 | 116 | $this->assertEquals( |
117 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
118 | - $this->generateOutput(' 1/50 [>---------------------------] 2%'). |
|
119 | - $this->generateOutput(' 15/50 [========>-------------------] 30%'). |
|
117 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
118 | + $this->generateOutput(' 1/50 [>---------------------------] 2%') . |
|
119 | + $this->generateOutput(' 15/50 [========>-------------------] 30%') . |
|
120 | 120 | $this->generateOutput(' 25/50 [==============>-------------] 50%'), |
121 | 121 | stream_get_contents($output->getStream()) |
122 | 122 | ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | rewind($output->getStream()); |
185 | 185 | $this->assertEquals( |
186 | - $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''), |
|
186 | + $this->generateOutput(' 25/50 [==============>-------------] 50%') . $this->generateOutput(''), |
|
187 | 187 | stream_get_contents($output->getStream()) |
188 | 188 | ); |
189 | 189 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $progress->advance(); |
198 | 198 | |
199 | 199 | rewind($output->getStream()); |
200 | - $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream())); |
|
200 | + $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%') . $this->generateOutput(' 199/200 [===========================>] 99%') . $this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream())); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | public function testNonDecoratedOutput() |
@@ -227,6 +227,6 @@ discard block |
||
227 | 227 | |
228 | 228 | $this->lastMessagesLength = strlen($expectedout); |
229 | 229 | |
230 | - return "\x0D".$expectedout; |
|
230 | + return "\x0D" . $expectedout; |
|
231 | 231 | } |
232 | 232 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $output = $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL); |
40 | 40 | |
41 | 41 | $executed = false; |
42 | - $callback = function () use (&$executed) { $executed = true; }; |
|
42 | + $callback = function() use (&$executed) { $executed = true; }; |
|
43 | 43 | |
44 | 44 | $helper->run($output, 'php -r "echo 42;"', null, $callback); |
45 | 45 | $this->assertTrue($executed); |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | array('', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null), |
97 | 97 | array($syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null), |
98 | 98 | array($syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null), |
99 | - array($errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage), |
|
100 | - array($syntaxErrorOutputVerbose.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage), |
|
101 | - array($syntaxErrorOutputDebug.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage), |
|
99 | + array($errorMessage . PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage), |
|
100 | + array($syntaxErrorOutputVerbose . $errorMessage . PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage), |
|
101 | + array($syntaxErrorOutputDebug . $errorMessage . PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage), |
|
102 | 102 | array($successOutputProcessDebug, array('php', '-r', 'echo 42;'), StreamOutput::VERBOSITY_DEBUG, null), |
103 | 103 | array($successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null), |
104 | 104 | ); |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | rewind($output->getStream()); |
28 | 28 | $this->assertEquals( |
29 | - $this->generateOutput(' 0 [>---------------------------]'). |
|
30 | - $this->generateOutput(' 1 [->--------------------------]'). |
|
29 | + $this->generateOutput(' 0 [>---------------------------]') . |
|
30 | + $this->generateOutput(' 1 [->--------------------------]') . |
|
31 | 31 | $this->generateOutput(' 0 [>---------------------------]'), |
32 | 32 | stream_get_contents($output->getStream()) |
33 | 33 | ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | rewind($output->getStream()); |
43 | 43 | $this->assertEquals( |
44 | - $this->generateOutput(' 0 [>---------------------------]'). |
|
44 | + $this->generateOutput(' 0 [>---------------------------]') . |
|
45 | 45 | $this->generateOutput(' 1 [->--------------------------]'), |
46 | 46 | stream_get_contents($output->getStream()) |
47 | 47 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | rewind($output->getStream()); |
57 | 57 | $this->assertEquals( |
58 | - $this->generateOutput(' 0 [>---------------------------]'). |
|
58 | + $this->generateOutput(' 0 [>---------------------------]') . |
|
59 | 59 | $this->generateOutput(' 5 [----->----------------------]'), |
60 | 60 | stream_get_contents($output->getStream()) |
61 | 61 | ); |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | |
71 | 71 | rewind($output->getStream()); |
72 | 72 | $this->assertEquals( |
73 | - $this->generateOutput(' 0 [>---------------------------]'). |
|
74 | - $this->generateOutput(' 3 [--->------------------------]'). |
|
73 | + $this->generateOutput(' 0 [>---------------------------]') . |
|
74 | + $this->generateOutput(' 3 [--->------------------------]') . |
|
75 | 75 | $this->generateOutput(' 5 [----->----------------------]'), |
76 | 76 | stream_get_contents($output->getStream()) |
77 | 77 | ); |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | |
87 | 87 | rewind($output->getStream()); |
88 | 88 | $this->assertEquals( |
89 | - $this->generateOutput(' 9/10 [=========================>--] 90%'). |
|
90 | - $this->generateOutput(' 10/10 [============================] 100%'). |
|
89 | + $this->generateOutput(' 9/10 [=========================>--] 90%') . |
|
90 | + $this->generateOutput(' 10/10 [============================] 100%') . |
|
91 | 91 | $this->generateOutput(' 11/11 [============================] 100%'), |
92 | 92 | stream_get_contents($output->getStream()) |
93 | 93 | ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | rewind($output->getStream()); |
108 | 108 | $this->assertEquals( |
109 | - $this->generateOutput(' 0/10 [/ ] 0%'). |
|
109 | + $this->generateOutput(' 0/10 [/ ] 0%') . |
|
110 | 110 | $this->generateOutput(' 1/10 [_/ ] 10%'), |
111 | 111 | stream_get_contents($output->getStream()) |
112 | 112 | ); |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | |
159 | 159 | rewind($output->getStream()); |
160 | 160 | $this->assertEquals( |
161 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
162 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
163 | - $this->generateOutput(' 1/50 [>---------------------------] 2%'). |
|
161 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
162 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
163 | + $this->generateOutput(' 1/50 [>---------------------------] 2%') . |
|
164 | 164 | $this->generateOutput(' 2/50 [=>--------------------------] 4%'), |
165 | 165 | stream_get_contents($output->getStream()) |
166 | 166 | ); |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | |
181 | 181 | rewind($output->getStream()); |
182 | 182 | $this->assertEquals( |
183 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
184 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
185 | - $this->generateOutput(' 1/50 [>---------------------------] 2%'). |
|
183 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
184 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
185 | + $this->generateOutput(' 1/50 [>---------------------------] 2%') . |
|
186 | 186 | $this->generateOutput(' 2/50 [=>--------------------------] '), |
187 | 187 | stream_get_contents($output->getStream()) |
188 | 188 | ); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | rewind($output->getStream()); |
199 | 199 | $this->assertEquals( |
200 | - $this->generateOutput(' 0/50 [>---------------------------]'). |
|
200 | + $this->generateOutput(' 0/50 [>---------------------------]') . |
|
201 | 201 | $this->generateOutput(' 1/50 [>---------------------------]'), |
202 | 202 | stream_get_contents($output->getStream()) |
203 | 203 | ); |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | |
215 | 215 | rewind($output->getStream()); |
216 | 216 | $this->assertEquals( |
217 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
218 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
219 | - $this->generateOutput(' 1/50 [>---------------------------] 2%'). |
|
220 | - $this->generateOutput(' 15/50 [========>-------------------] 30%'). |
|
217 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
218 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
219 | + $this->generateOutput(' 1/50 [>---------------------------] 2%') . |
|
220 | + $this->generateOutput(' 15/50 [========>-------------------] 30%') . |
|
221 | 221 | $this->generateOutput(' 25/50 [==============>-------------] 50%'), |
222 | 222 | stream_get_contents($output->getStream()) |
223 | 223 | ); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | rewind($output->getStream()); |
272 | 272 | $this->assertEquals( |
273 | - $this->generateOutput(' 0 [>---------------------------]'). |
|
273 | + $this->generateOutput(' 0 [>---------------------------]') . |
|
274 | 274 | $this->generateOutput(' 3 [■■■>------------------------]'), |
275 | 275 | stream_get_contents($output->getStream()) |
276 | 276 | ); |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | |
286 | 286 | rewind($output->getStream()); |
287 | 287 | $this->assertEquals( |
288 | - $this->generateOutput(' 0/50 [>---------------------------] 0%'). |
|
289 | - $this->generateOutput(' 25/50 [==============>-------------] 50%'). |
|
288 | + $this->generateOutput(' 0/50 [>---------------------------] 0%') . |
|
289 | + $this->generateOutput(' 25/50 [==============>-------------] 50%') . |
|
290 | 290 | $this->generateOutput(' '), |
291 | 291 | stream_get_contents($output->getStream()) |
292 | 292 | ); |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | |
303 | 303 | rewind($output->getStream()); |
304 | 304 | $this->assertEquals( |
305 | - $this->generateOutput(' 0/200 [>---------------------------] 0%'). |
|
306 | - $this->generateOutput(' 0/200 [>---------------------------] 0%'). |
|
307 | - $this->generateOutput(' 199/200 [===========================>] 99%'). |
|
305 | + $this->generateOutput(' 0/200 [>---------------------------] 0%') . |
|
306 | + $this->generateOutput(' 0/200 [>---------------------------] 0%') . |
|
307 | + $this->generateOutput(' 199/200 [===========================>] 99%') . |
|
308 | 308 | $this->generateOutput(' 200/200 [============================] 100%'), |
309 | 309 | stream_get_contents($output->getStream()) |
310 | 310 | ); |
@@ -323,16 +323,16 @@ discard block |
||
323 | 323 | |
324 | 324 | rewind($output->getStream()); |
325 | 325 | $this->assertEquals( |
326 | - " 0/200 [>---------------------------] 0%\n". |
|
327 | - " 20/200 [==>-------------------------] 10%\n". |
|
328 | - " 40/200 [=====>----------------------] 20%\n". |
|
329 | - " 60/200 [========>-------------------] 30%\n". |
|
330 | - " 80/200 [===========>----------------] 40%\n". |
|
331 | - " 100/200 [==============>-------------] 50%\n". |
|
332 | - " 120/200 [================>-----------] 60%\n". |
|
333 | - " 140/200 [===================>--------] 70%\n". |
|
334 | - " 160/200 [======================>-----] 80%\n". |
|
335 | - " 180/200 [=========================>--] 90%\n". |
|
326 | + " 0/200 [>---------------------------] 0%\n" . |
|
327 | + " 20/200 [==>-------------------------] 10%\n" . |
|
328 | + " 40/200 [=====>----------------------] 20%\n" . |
|
329 | + " 60/200 [========>-------------------] 30%\n" . |
|
330 | + " 80/200 [===========>----------------] 40%\n" . |
|
331 | + " 100/200 [==============>-------------] 50%\n" . |
|
332 | + " 120/200 [================>-----------] 60%\n" . |
|
333 | + " 140/200 [===================>--------] 70%\n" . |
|
334 | + " 160/200 [======================>-----] 80%\n" . |
|
335 | + " 180/200 [=========================>--] 90%\n" . |
|
336 | 336 | " 200/200 [============================] 100%", |
337 | 337 | stream_get_contents($output->getStream()) |
338 | 338 | ); |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | |
350 | 350 | rewind($output->getStream()); |
351 | 351 | $this->assertEquals( |
352 | - " 0/50 [>---------------------------] 0%\n". |
|
353 | - " 25/50 [==============>-------------] 50%\n". |
|
352 | + " 0/50 [>---------------------------] 0%\n" . |
|
353 | + " 25/50 [==============>-------------] 50%\n" . |
|
354 | 354 | " 50/50 [============================] 100%", |
355 | 355 | stream_get_contents($output->getStream()) |
356 | 356 | ); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | |
365 | 365 | rewind($output->getStream()); |
366 | 366 | $this->assertEquals( |
367 | - " 0 [>---------------------------]\n". |
|
367 | + " 0 [>---------------------------]\n" . |
|
368 | 368 | " 1 [->--------------------------]", |
369 | 369 | stream_get_contents($output->getStream()) |
370 | 370 | ); |
@@ -402,28 +402,28 @@ discard block |
||
402 | 402 | |
403 | 403 | rewind($output->getStream()); |
404 | 404 | $this->assertEquals( |
405 | - $this->generateOutput(' 0/2 [>---------------------------] 0%')."\n". |
|
406 | - $this->generateOutput(' 0/3 [#---------------------------] 0%')."\n". |
|
407 | - rtrim($this->generateOutput(' 0 [>---------------------------]')). |
|
408 | - |
|
409 | - "\033[2A". |
|
410 | - $this->generateOutput(' 1/2 [==============>-------------] 50%')."\n". |
|
411 | - $this->generateOutput(' 1/3 [=========#------------------] 33%')."\n". |
|
412 | - rtrim($this->generateOutput(' 1 [->--------------------------]')). |
|
413 | - |
|
414 | - "\033[2A". |
|
415 | - $this->generateOutput(' 2/2 [============================] 100%')."\n". |
|
416 | - $this->generateOutput(' 2/3 [==================#---------] 66%')."\n". |
|
417 | - rtrim($this->generateOutput(' 2 [-->-------------------------]')). |
|
418 | - |
|
419 | - "\033[2A". |
|
420 | - "\n". |
|
421 | - $this->generateOutput(' 3/3 [============================] 100%')."\n". |
|
422 | - rtrim($this->generateOutput(' 3 [--->------------------------]')). |
|
423 | - |
|
424 | - "\033[2A". |
|
425 | - "\n". |
|
426 | - "\n". |
|
405 | + $this->generateOutput(' 0/2 [>---------------------------] 0%') . "\n" . |
|
406 | + $this->generateOutput(' 0/3 [#---------------------------] 0%') . "\n" . |
|
407 | + rtrim($this->generateOutput(' 0 [>---------------------------]')) . |
|
408 | + |
|
409 | + "\033[2A" . |
|
410 | + $this->generateOutput(' 1/2 [==============>-------------] 50%') . "\n" . |
|
411 | + $this->generateOutput(' 1/3 [=========#------------------] 33%') . "\n" . |
|
412 | + rtrim($this->generateOutput(' 1 [->--------------------------]')) . |
|
413 | + |
|
414 | + "\033[2A" . |
|
415 | + $this->generateOutput(' 2/2 [============================] 100%') . "\n" . |
|
416 | + $this->generateOutput(' 2/3 [==================#---------] 66%') . "\n" . |
|
417 | + rtrim($this->generateOutput(' 2 [-->-------------------------]')) . |
|
418 | + |
|
419 | + "\033[2A" . |
|
420 | + "\n" . |
|
421 | + $this->generateOutput(' 3/3 [============================] 100%') . "\n" . |
|
422 | + rtrim($this->generateOutput(' 3 [--->------------------------]')) . |
|
423 | + |
|
424 | + "\033[2A" . |
|
425 | + "\n" . |
|
426 | + "\n" . |
|
427 | 427 | rtrim($this->generateOutput(' 3 [============================]')), |
428 | 428 | stream_get_contents($output->getStream()) |
429 | 429 | ); |
@@ -442,10 +442,10 @@ discard block |
||
442 | 442 | |
443 | 443 | rewind($output->getStream()); |
444 | 444 | $this->assertEquals( |
445 | - rtrim($this->generateOutput(' 0 [>---------------------------]')). |
|
446 | - rtrim($this->generateOutput(' 1 [->--------------------------]')). |
|
447 | - rtrim($this->generateOutput(' 2 [-->-------------------------]')). |
|
448 | - rtrim($this->generateOutput(' 3 [--->------------------------]')). |
|
445 | + rtrim($this->generateOutput(' 0 [>---------------------------]')) . |
|
446 | + rtrim($this->generateOutput(' 1 [->--------------------------]')) . |
|
447 | + rtrim($this->generateOutput(' 2 [-->-------------------------]')) . |
|
448 | + rtrim($this->generateOutput(' 3 [--->------------------------]')) . |
|
449 | 449 | rtrim($this->generateOutput(' 3 [============================]')), |
450 | 450 | stream_get_contents($output->getStream()) |
451 | 451 | ); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | public function testAddingPlaceholderFormatter() |
455 | 455 | { |
456 | - ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) { |
|
456 | + ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function(ProgressBar $bar) { |
|
457 | 457 | return $bar->getMaxSteps() - $bar->getProgress(); |
458 | 458 | }); |
459 | 459 | $bar = new ProgressBar($output = $this->getOutputStream(), 3); |
@@ -465,8 +465,8 @@ discard block |
||
465 | 465 | |
466 | 466 | rewind($output->getStream()); |
467 | 467 | $this->assertEquals( |
468 | - $this->generateOutput(' 3 [>---------------------------]'). |
|
469 | - $this->generateOutput(' 2 [=========>------------------]'). |
|
468 | + $this->generateOutput(' 3 [>---------------------------]') . |
|
469 | + $this->generateOutput(' 2 [=========>------------------]') . |
|
470 | 470 | $this->generateOutput(' 0 [============================]'), |
471 | 471 | stream_get_contents($output->getStream()) |
472 | 472 | ); |
@@ -484,9 +484,9 @@ discard block |
||
484 | 484 | |
485 | 485 | rewind($output->getStream()); |
486 | 486 | $this->assertEquals( |
487 | - $this->generateOutput(">---------------------------\nfoobar"). |
|
488 | - $this->generateOutput("=========>------------------\nfoobar "). |
|
489 | - $this->generateOutput(" \n "). |
|
487 | + $this->generateOutput(">---------------------------\nfoobar") . |
|
488 | + $this->generateOutput("=========>------------------\nfoobar ") . |
|
489 | + $this->generateOutput(" \n ") . |
|
490 | 490 | $this->generateOutput("============================\nfoobar "), |
491 | 491 | stream_get_contents($output->getStream()) |
492 | 492 | ); |
@@ -495,12 +495,12 @@ discard block |
||
495 | 495 | public function testAnsiColorsAndEmojis() |
496 | 496 | { |
497 | 497 | $bar = new ProgressBar($output = $this->getOutputStream(), 15); |
498 | - ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) { |
|
498 | + ProgressBar::setPlaceholderFormatterDefinition('memory', function(ProgressBar $bar) { |
|
499 | 499 | static $i = 0; |
500 | 500 | $mem = 100000 * $i; |
501 | 501 | $colors = $i++ ? '41;37' : '44;37'; |
502 | 502 | |
503 | - return "\033[".$colors."m ".Helper::formatMemory($mem)." \033[0m"; |
|
503 | + return "\033[" . $colors . "m " . Helper::formatMemory($mem) . " \033[0m"; |
|
504 | 504 | }); |
505 | 505 | $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n |
@@ -173,7 +173,7 @@ |
||
173 | 173 | $dialog->setHelperSet($helperSet); |
174 | 174 | |
175 | 175 | $error = 'This is not a color!'; |
176 | - $validator = function ($color) use ($error) { |
|
176 | + $validator = function($color) use ($error) { |
|
177 | 177 | if (!in_array($color, array('white', 'black'))) { |
178 | 178 | throw new \InvalidArgumentException($error); |
179 | 179 | } |
@@ -284,7 +284,7 @@ |
||
284 | 284 | $this->assertEquals('-f foo', (string) $input); |
285 | 285 | |
286 | 286 | $input = new ArgvInput(array('cli.php', '-f', '--bar=foo', 'a b c d', "A\nB'C")); |
287 | - $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input); |
|
287 | + $this->assertEquals('-f --bar=foo ' . escapeshellarg('a b c d') . ' ' . escapeshellarg("A\nB'C"), (string) $input); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
@@ -133,6 +133,6 @@ |
||
133 | 133 | public function testToString() |
134 | 134 | { |
135 | 135 | $input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C")); |
136 | - $this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input); |
|
136 | + $this->assertEquals('-f -b=bar --foo=' . escapeshellarg('b a z') . ' --lala Foo ' . escapeshellarg("A\nB'C"), (string) $input); |
|
137 | 137 | } |
138 | 138 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | public static function setUpBeforeClass() |
25 | 25 | { |
26 | - self::$fixtures = __DIR__.'/../Fixtures/'; |
|
26 | + self::$fixtures = __DIR__ . '/../Fixtures/'; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testConstructorArguments() |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')), |
391 | 391 | new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')), |
392 | 392 | )); |
393 | - $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); |
|
393 | + $this->assertStringEqualsFile(self::$fixtures . '/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), |
409 | 409 | new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), |
410 | 410 | )); |
411 | - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); |
|
411 | + $this->assertXmlStringEqualsXmlFile(self::$fixtures . '/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | protected function initializeArguments() |