StringInput resets the given options.
This commit is contained in:
parent
da0b0426ef
commit
635b1fcb77
@ -12,6 +12,8 @@
|
||||
namespace Symfony\Component\Console\Tests\Input;
|
||||
|
||||
use Symfony\Component\Console\Input\StringInput;
|
||||
use Symfony\Component\Console\Input\InputDefinition;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
class StringInputTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -27,6 +29,18 @@ class StringInputTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($tokens, $p->getValue($input), $message);
|
||||
}
|
||||
|
||||
public function testInputOptionWithGivenString()
|
||||
{
|
||||
$definition = new InputDefinition(
|
||||
array(new InputOption('foo', null, InputOption::VALUE_REQUIRED))
|
||||
);
|
||||
|
||||
$input = new StringInput('--foo=bar', $definition);
|
||||
$actual = $input->getOption('foo');
|
||||
|
||||
$this->assertEquals('bar', $actual);
|
||||
}
|
||||
|
||||
public function getTokenizeData()
|
||||
{
|
||||
return array(
|
||||
|
Reference in New Issue
Block a user