use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
class ArrayInputTest extends TestCase
{ public function testGetFirstArgument() { $input =
new ArrayInput([]);
$this->
assertNull($input->
getFirstArgument(), '->getFirstArgument() returns null if no argument were passed'
);
$input =
new ArrayInput(['name' => 'Fabien'
]);
$this->
assertEquals('Fabien',
$input->
getFirstArgument(), '->getFirstArgument() returns the first passed argument'
);
$input =
new ArrayInput(['--foo' => 'bar', 'name' => 'Fabien'
]);
$this->
assertEquals('Fabien',
$input->
getFirstArgument(), '->getFirstArgument() returns the first passed argument'
);
} public function testHasParameterOption() { $input =
new ArrayInput(['name' => 'Fabien', '--foo' => 'bar'
]);
$this->
assertTrue($input->
hasParameterOption('--foo'
), '->hasParameterOption() returns true if an option is present in the passed parameters'
);