You are here

public function CommandTest::testGetSetHelp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Tests/Command/CommandTest.php \Symfony\Component\Console\Tests\Command\CommandTest::testGetSetHelp()

File

vendor/symfony/console/Tests/Command/CommandTest.php, line 127

Class

CommandTest

Namespace

Symfony\Component\Console\Tests\Command

Code

public function testGetSetHelp() {
  $command = new \TestCommand();
  $this
    ->assertEquals('help', $command
    ->getHelp(), '->getHelp() returns the help');
  $ret = $command
    ->setHelp('help1');
  $this
    ->assertEquals($command, $ret, '->setHelp() implements a fluent interface');
  $this
    ->assertEquals('help1', $command
    ->getHelp(), '->setHelp() sets the help');
  $command
    ->setHelp('');
  $this
    ->assertEquals('description', $command
    ->getHelp(), '->getHelp() fallback to the description');
}