[Console] added string input test
This commit is contained in:
parent
32f190481a
commit
6b98883903
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Console\Tests\Input;
|
namespace Symfony\Component\Console\Tests\Input;
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Input\InputDefinition;
|
||||||
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\StringInput;
|
use Symfony\Component\Console\Input\StringInput;
|
||||||
|
|
||||||
class StringInputTest extends \PHPUnit_Framework_TestCase
|
class StringInputTest extends \PHPUnit_Framework_TestCase
|
||||||
@ -27,6 +29,19 @@ class StringInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($tokens, $p->getValue($input), $message);
|
$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');
|
||||||
|
$input->bind($definition);
|
||||||
|
$actual = $input->getOption('foo');
|
||||||
|
|
||||||
|
$this->assertEquals('bar', $actual);
|
||||||
|
}
|
||||||
|
|
||||||
public function getTokenizeData()
|
public function getTokenizeData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
Reference in New Issue
Block a user