X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fconsole%2FTests%2FCommand%2FCommandTest.php;fp=vendor%2Fsymfony%2Fconsole%2FTests%2FCommand%2FCommandTest.php;h=93b4721c393dd5c8c51b318a34808a9c1710d221;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=ac4aa22fbb772132dbef34383c69fb15df973d86;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/symfony/console/Tests/Command/CommandTest.php b/vendor/symfony/console/Tests/Command/CommandTest.php index ac4aa22fb..93b4721c3 100644 --- a/vendor/symfony/console/Tests/Command/CommandTest.php +++ b/vendor/symfony/console/Tests/Command/CommandTest.php @@ -93,6 +93,13 @@ class CommandTest extends TestCase $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command'); } + public function testSetHidden() + { + $command = new \TestCommand(); + $command->setHidden(true); + $this->assertTrue($command->isHidden()); + } + public function testGetNamespaceGetNameSetName() { $command = new \TestCommand(); @@ -363,7 +370,6 @@ class CommandTest extends TestCase /** * @dataProvider getSetCodeBindToClosureTests - * @requires PHP 5.4 */ public function testSetCodeBindToClosure($previouslyBound, $expected) { @@ -412,44 +418,10 @@ class CommandTest extends TestCase $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid callable provided to Command::setCode. - */ - public function testSetCodeWithNonCallable() - { - $command = new \TestCommand(); - $command->setCode(array($this, 'nonExistentMethod')); - } - public function callableMethodCommand(InputInterface $input, OutputInterface $output) { $output->writeln('from the code...'); } - - /** - * @group legacy - */ - public function testLegacyAsText() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command'); - } } // In order to get an unbound closure, we should create it outside a class