Skip to content

Commit 5c4f7b7

Browse files
committed
add more tests for command()
1 parent 3fa804c commit 5c4f7b7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/system/Commands/HelpCommandTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16+
use CodeIgniter\CodeIgniter;
1617
use CodeIgniter\Test\CIUnitTestCase;
1718
use CodeIgniter\Test\StreamFilterTrait;
1819
use PHPUnit\Framework\Attributes\Group;
@@ -63,4 +64,22 @@ 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+
$this->assertStringNotContainsString(
72+
sprintf('CodeIgniter %s Command Line Tool', CodeIgniter::CI_VERSION),
73+
$this->getBuffer(),
74+
);
75+
}
76+
77+
public function testHelpCommandWithDoubleHyphenStillRemovesBanner(): void
78+
{
79+
command('help -- list');
80+
$this->assertStringNotContainsString(
81+
sprintf('CodeIgniter %s Command Line Tool', CodeIgniter::CI_VERSION),
82+
$this->getBuffer(),
83+
);
84+
}
6685
}

0 commit comments

Comments
 (0)