@@ -51,6 +51,21 @@ public function iRunTheCommandAndIProvideAsInput($name, TableNode $input)
5151 $ this ->runCommandWithInteractiveInput ($ name , $ inputs );
5252 }
5353
54+ /**
55+ * @Given /^I run the command "([^"]*)" and I provide as input "([^"]*)" with parameters$/
56+ * @Given /^parameters"$/
57+ */
58+ public function iRunTheCommandAndIProvideAsInputAndParameters ($ name , $ input , TableNode $ parameters )
59+ {
60+ $ parameters = $ parameters ->getHash ();
61+ $ parameters = array_combine (
62+ array_column ($ parameters , 'Parameter ' ),
63+ array_column ($ parameters , 'Value ' )
64+ );
65+
66+ $ this ->runCommandWithInteractiveInputAndParameters ($ name , [$ input ], $ parameters );
67+ }
68+
5469 /**
5570 * @Given /^I run the command "([^"]*)" and I provide as input "([^"]*)"$/
5671 */
@@ -70,6 +85,12 @@ public function theOutputShouldBe(PyStringNode $expectedOutput)
7085 );
7186 }
7287
88+ private function runCommandWithInteractiveInputAndParameters ($ name , array $ inputs , array $ parameters )
89+ {
90+ $ this ->tester ->setInputs ($ inputs );
91+ $ this ->tester ->run (\array_merge (['command ' => $ name ], $ parameters ), array ('interactive ' => true , 'decorated ' => false ));
92+ }
93+
7394 private function runCommandWithInteractiveInput ($ name , array $ inputs )
7495 {
7596 $ this ->tester ->setInputs ($ inputs );
0 commit comments