You are here

public function CommandTest::testSetCodeWithNonClosureCallable 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::testSetCodeWithNonClosureCallable()

File

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

Class

CommandTest

Namespace

Symfony\Component\Console\Tests\Command

Code

public function testSetCodeWithNonClosureCallable() {
  $command = new \TestCommand();
  $ret = $command
    ->setCode(array(
    $this,
    'callableMethodCommand',
  ));
  $this
    ->assertEquals($command, $ret, '->setCode() implements a fluent interface');
  $tester = new CommandTester($command);
  $tester
    ->execute(array());
  $this
    ->assertEquals('interact called' . PHP_EOL . 'from the code...' . PHP_EOL, $tester
    ->getDisplay());
}