You are here

public function HelperSetTest::testSetCommand in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Helper/HelperSetTest.php \Symfony\Component\Console\Tests\Helper\HelperSetTest::testSetCommand()

@covers \Symfony\Component\Console\Helper\HelperSet::setCommand

File

vendor/symfony/console/Tests/Helper/HelperSetTest.php, line 88

Class

HelperSetTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testSetCommand() {
  $cmd_01 = new Command('foo');
  $cmd_02 = new Command('bar');
  $helperset = new HelperSet();
  $helperset
    ->setCommand($cmd_01);
  $this
    ->assertEquals($cmd_01, $helperset
    ->getCommand(), '->setCommand() stores given command');
  $helperset = new HelperSet();
  $helperset
    ->setCommand($cmd_01);
  $helperset
    ->setCommand($cmd_02);
  $this
    ->assertEquals($cmd_02, $helperset
    ->getCommand(), '->setCommand() overwrites stored command with consecutive calls');
}