@@ -112,6 +112,31 @@ public function testCommandWithInputs()
112
112
$ this ->assertEquals (implode ('' , $ questions ), $ tester ->getDisplay (true ));
113
113
}
114
114
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
+
115
140
/**
116
141
* @expectedException \RuntimeException
117
142
* @expectedMessage Aborted
0 commit comments