You are here

public function ArrayInputTest::testHasParameterOption in Zircon Profile 8

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

File

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

Class

ArrayInputTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testHasParameterOption() {
  $input = new ArrayInput(array(
    'name' => 'Fabien',
    '--foo' => 'bar',
  ));
  $this
    ->assertTrue($input
    ->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
  $this
    ->assertFalse($input
    ->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters');
  $input = new ArrayInput(array(
    '--foo',
  ));
  $this
    ->assertTrue($input
    ->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
}