You are here

public function CommandTest::testGetNamespaceGetNameSetName in Zircon Profile 8

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

File

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

Class

CommandTest

Namespace

Symfony\Component\Console\Tests\Command

Code

public function testGetNamespaceGetNameSetName() {
  $command = new \TestCommand();
  $this
    ->assertEquals('namespace:name', $command
    ->getName(), '->getName() returns the command name');
  $command
    ->setName('foo');
  $this
    ->assertEquals('foo', $command
    ->getName(), '->setName() sets the command name');
  $ret = $command
    ->setName('foobar:bar');
  $this
    ->assertEquals($command, $ret, '->setName() implements a fluent interface');
  $this
    ->assertEquals('foobar:bar', $command
    ->getName(), '->setName() sets the command name');
}