You are here

public function ArrayInputTest::testGetFirstArgument in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Tests/Input/ArrayInputTest.php \Symfony\Component\Console\Tests\Input\ArrayInputTest::testGetFirstArgument()

File

vendor/symfony/console/Tests/Input/ArrayInputTest.php, line 21

Class

ArrayInputTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testGetFirstArgument() {
  $input = new ArrayInput(array());
  $this
    ->assertNull($input
    ->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed');
  $input = new ArrayInput(array(
    'name' => 'Fabien',
  ));
  $this
    ->assertEquals('Fabien', $input
    ->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
  $input = new ArrayInput(array(
    '--foo' => 'bar',
    'name' => 'Fabien',
  ));
  $this
    ->assertEquals('Fabien', $input
    ->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
}