File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1313
1414namespace CodeIgniter \Commands ;
1515
16+ use CodeIgniter \CodeIgniter ;
1617use CodeIgniter \Test \CIUnitTestCase ;
1718use CodeIgniter \Test \StreamFilterTrait ;
1819use PHPUnit \Framework \Attributes \Group ;
@@ -63,4 +64,26 @@ public function testHelpCommandOnInexistentCommandButWithAlternatives(): void
6364 $ this ->assertStringContainsString ('Command "clear" not found. ' , $ this ->getBuffer ());
6465 $ this ->assertStringContainsString ('Did you mean one of these? ' , $ this ->getBuffer ());
6566 }
67+
68+ public function testNormalHelpCommandHasNoBanner (): void
69+ {
70+ command ('help ' );
71+
72+ $ this ->assertStringNotContainsString (
73+ sprintf ('CodeIgniter %s Command Line Tool ' , CodeIgniter::CI_VERSION ),
74+ $ this ->getBuffer (),
75+ );
76+ $ this ->assertStringContainsString ('Displays basic usage information. ' , $ this ->getBuffer ());
77+ }
78+
79+ public function testHelpCommandWithDoubleHyphenStillRemovesBanner (): void
80+ {
81+ command ('help -- list ' );
82+
83+ $ this ->assertStringNotContainsString (
84+ sprintf ('CodeIgniter %s Command Line Tool ' , CodeIgniter::CI_VERSION ),
85+ $ this ->getBuffer (),
86+ );
87+ $ this ->assertStringContainsString ('Lists the available commands. ' , $ this ->getBuffer ());
88+ }
6689}
You can’t perform that action at this time.
0 commit comments