|
@@ -157,6 +157,25 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
|
|
|
$input = new TestInput(array('cli.php', 'foo'));
|
|
|
$this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input');
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @dataProvider provideGetParameterOptionValues
|
|
|
+ */
|
|
|
+ public function testGetParameterOptionEqualSign($argv, $key, $expected)
|
|
|
+ {
|
|
|
+ $input = new ArgvInput($argv);
|
|
|
+ $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function provideGetParameterOptionValues()
|
|
|
+ {
|
|
|
+ return array(
|
|
|
+ array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'),
|
|
|
+ array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'),
|
|
|
+ array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'),
|
|
|
+ array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class TestInput extends ArgvInput
|