@@ -114,6 +114,92 @@ public function will(PHPUnit_Framework_MockObject_Stub $stub)
114
114
return $ this ;
115
115
}
116
116
117
+ /**
118
+ * @param mixed $value
119
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
120
+ */
121
+ public function willReturn ($ value )
122
+ {
123
+ $ stub = new PHPUnit_Framework_MockObject_Stub_Return (
124
+ $ value
125
+ );
126
+
127
+ return $ this ->will ($ stub );
128
+ }
129
+
130
+ /**
131
+ * @param array $valueMap
132
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
133
+ */
134
+ public function willReturnMap (array $ valueMap )
135
+ {
136
+ $ stub = new PHPUnit_Framework_MockObject_Stub_ReturnValueMap (
137
+ $ valueMap
138
+ );
139
+
140
+ return $ this ->will ($ stub );
141
+ }
142
+
143
+ /**
144
+ * @param mixed $argumentIndex
145
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
146
+ */
147
+ public function willReturnArgument ($ argumentIndex )
148
+ {
149
+ $ stub = new PHPUnit_Framework_MockObject_Stub_ReturnArgument (
150
+ $ argumentIndex
151
+ );
152
+
153
+ return $ this ->will ($ stub );
154
+ }
155
+
156
+ /**
157
+ * @param callable $callback
158
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
159
+ */
160
+ public function willReturnCallback ($ callback )
161
+ {
162
+ $ stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback (
163
+ $ callback
164
+ );
165
+
166
+ return $ this ->will ($ stub );
167
+ }
168
+
169
+ /**
170
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
171
+ */
172
+ public function willReturnSelf ()
173
+ {
174
+ $ stub = new PHPUnit_Framework_MockObject_Stub_ReturnSelf ();
175
+
176
+ return $ this ->will ($ stub );
177
+ }
178
+
179
+ /**
180
+ * @param mixed $value, ...
181
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
182
+ */
183
+ public function willReturnOnConsecutiveCalls ()
184
+ {
185
+ $ args = func_get_args ();
186
+
187
+ $ stub = new PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls ($ args );
188
+
189
+ return $ this ->will ($ stub );
190
+ }
191
+
192
+ /**
193
+ * @param Exception $exception
194
+ * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
195
+ */
196
+ public function willThrowException (Exception $ exception )
197
+ {
198
+ $ stub = new PHPUnit_Framework_MockObject_Stub_Exception ($ exception );
199
+
200
+ return $ this ->will ($ stub );
201
+ }
202
+
117
203
/**
118
204
* @param mixed $id
119
205
* @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
0 commit comments