@@ -37,12 +37,12 @@ public function testInfoComment()
3737 {
3838 $ command = new MockableTestCommand ();
3939 $ command ->closure = function (Command $ command ) {
40- $ command ->infoComment ('foo ' , ' bar ' );
40+ $ command ->infoComment ('foo [ bar] ' );
4141 };
4242
4343 $ output = $ this ->mock (OutputStyle::class);
4444 $ output ->shouldReceive ('writeln ' )->once ()->withArgs (function (string $ message ): bool {
45- return $ message === '<info>foo</info> [<comment>bar</comment>] ' ;
45+ return $ message === '<info>foo </info>[<comment>bar</comment>]<info></info> ' ;
4646 });
4747
4848 $ command ->setMockedOutput ($ output );
@@ -53,12 +53,28 @@ public function testInfoCommentWithExtraInfo()
5353 {
5454 $ command = new MockableTestCommand ();
5555 $ command ->closure = function (Command $ command ) {
56- $ command ->infoComment ('foo ' , ' bar ' , ' baz ' );
56+ $ command ->infoComment ('foo [ bar] baz ' );
5757 };
5858
5959 $ output = $ this ->mock (OutputStyle::class);
6060 $ output ->shouldReceive ('writeln ' )->once ()->withArgs (function (string $ message ): bool {
61- return $ message === '<info>foo</info> [<comment>bar</comment>] <info>baz</info> ' ;
61+ return $ message === '<info>foo </info>[<comment>bar</comment>]<info> baz</info> ' ;
62+ });
63+
64+ $ command ->setMockedOutput ($ output );
65+ $ command ->handle ();
66+ }
67+
68+ public function testInfoCommentWithExtraInfoAndComments ()
69+ {
70+ $ command = new MockableTestCommand ();
71+ $ command ->closure = function (Command $ command ) {
72+ $ command ->infoComment ('foo [bar] baz [qux] ' );
73+ };
74+
75+ $ output = $ this ->mock (OutputStyle::class);
76+ $ output ->shouldReceive ('writeln ' )->once ()->withArgs (function (string $ message ): bool {
77+ return $ message === '<info>foo </info>[<comment>bar</comment>]<info> baz </info>[<comment>qux</comment>]<info></info> ' ;
6278 });
6379
6480 $ command ->setMockedOutput ($ output );
0 commit comments