@@ -112,6 +112,31 @@ public function testCommandWithInputs()
112112 $ this ->assertEquals (implode ('' , $ questions ), $ tester ->getDisplay (true ));
113113 }
114114
115+ public function testCommandWithDefaultInputs ()
116+ {
117+ $ questions = array (
118+ 'What \'s your name? ' ,
119+ 'How are you? ' ,
120+ 'Where do you come from? ' ,
121+ );
122+
123+ $ command = new Command ('foo ' );
124+ $ command ->setHelperSet (new HelperSet (array (new QuestionHelper ())));
125+ $ command ->setCode (function ($ input , $ output ) use ($ questions , $ command ) {
126+ $ helper = $ command ->getHelper ('question ' );
127+ $ helper ->ask ($ input , $ output , new Question ($ questions [0 ], 'Bobby ' ));
128+ $ helper ->ask ($ input , $ output , new Question ($ questions [1 ], 'Fine ' ));
129+ $ helper ->ask ($ input , $ output , new Question ($ questions [2 ], 'France ' ));
130+ });
131+
132+ $ tester = new CommandTester ($ command );
133+ $ tester ->setInputs (array ('' , '' , '' ));
134+ $ tester ->execute (array ());
135+
136+ $ this ->assertEquals (0 , $ tester ->getStatusCode ());
137+ $ this ->assertEquals (implode ('' , $ questions ), $ tester ->getDisplay (true ));
138+ }
139+
115140 /**
116141 * @expectedException \RuntimeException
117142 * @expectedMessage Aborted
0 commit comments