You are here

public function InputOptionTest::testShortcut in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Input/InputOptionTest.php, line 35

Class

InputOptionTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testShortcut() {
  $option = new InputOption('foo', 'f');
  $this
    ->assertEquals('f', $option
    ->getShortcut(), '__construct() can take a shortcut as its second argument');
  $option = new InputOption('foo', '-f|-ff|fff');
  $this
    ->assertEquals('f|ff|fff', $option
    ->getShortcut(), '__construct() removes the leading - of the shortcuts');
  $option = new InputOption('foo', array(
    'f',
    'ff',
    '-fff',
  ));
  $this
    ->assertEquals('f|ff|fff', $option
    ->getShortcut(), '__construct() removes the leading - of the shortcuts');
  $option = new InputOption('foo');
  $this
    ->assertNull($option
    ->getShortcut(), '__construct() makes the shortcut null by default');
}