You are here

public function InputArgumentTest::testModes in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Input/InputArgumentTest.php, line 24

Class

InputArgumentTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testModes() {
  $argument = new InputArgument('foo');
  $this
    ->assertFalse($argument
    ->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default');
  $argument = new InputArgument('foo', null);
  $this
    ->assertFalse($argument
    ->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
  $argument = new InputArgument('foo', InputArgument::OPTIONAL);
  $this
    ->assertFalse($argument
    ->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
  $argument = new InputArgument('foo', InputArgument::REQUIRED);
  $this
    ->assertTrue($argument
    ->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode');
}