12 namespace Symfony\Component\Console\Tests\Tester;
26 $this->application->setAutoExit(
false);
27 $this->application->register(
'foo')
29 ->setCode(
function ($input, $output) { $output->writeln(
'foo'); })
33 $this->tester->run(array(
'command' =>
'foo',
'foo' =>
'bar'), array(
'interactive' =>
false,
'decorated' =>
false,
'verbosity' =>
Output::VERBOSITY_VERBOSE));
38 $this->application = null;
44 $this->assertFalse($this->tester->getInput()->isInteractive(),
'->execute() takes an interactive option');
45 $this->assertFalse($this->tester->getOutput()->isDecorated(),
'->execute() takes a decorated option');
46 $this->assertEquals(
Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(),
'->execute() takes a verbosity option');
51 $this->assertEquals(
'bar', $this->tester->getInput()->getArgument(
'foo'),
'->getInput() returns the current input instance');
56 rewind($this->tester->getOutput()->getStream());
57 $this->assertEquals(
'foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()),
'->getOutput() returns the current output instance');
62 $this->assertEquals(
'foo'.PHP_EOL, $this->tester->getDisplay(),
'->getDisplay() returns the display of the last execution');
67 $this->assertSame(0, $this->tester->getStatusCode(),
'->getStatusCode() returns the status code');