+ public function testInputWithDashDash()
+ {
+ $definition = new InputDefinition([
+ new InputOption('foo', null, InputOption::VALUE_REQUIRED),
+ new CodeArgument('code', null, CodeArgument::REQUIRED),
+ ]);
+
+ $input = new ShellInput('-- echo --foo::$bar');
+ $input->bind($definition);
+ $this->assertNull($input->getOption('foo'));
+ $this->assertSame('echo --foo::$bar', $input->getArgument('code'));
+ }
+
+ public function testInputWithEmptyString()
+ {
+ $definition = new InputDefinition([
+ new InputOption('foo', null, InputOption::VALUE_REQUIRED),
+ new CodeArgument('code', null, CodeArgument::REQUIRED),
+ ]);
+
+ $input = new ShellInput('"" --foo bar');
+ $input->bind($definition);
+ $this->assertSame('"" --foo bar', $input->getArgument('code'));
+ }
+
+ /**
+ * @dataProvider getTokenizeData
+ */
+ public function testTokenize($input, $tokens, $message)
+ {
+ $input = new ShellInput($input);
+ $r = new \ReflectionClass('Psy\Input\ShellInput');
+ $p = $r->getProperty('tokenPairs');
+ $p->setAccessible(true);
+ $this->assertSame($tokens, $p->getValue($input), $message);
+ }
+