We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7864d3 commit 62a9a26Copy full SHA for 62a9a26
README.md
@@ -293,6 +293,18 @@ $mockFunction->endScope();
293
sleep(1);//it'll do wait for 1 second because out of the scope
294
echo time();//it'll return the real time because it's out of the scope
295
```
296
+or short syntax, Return value can be added to mock function in two ways, type 1 and type 2.
297
+```php
298
+
299
+$mockFunction = new MockFunction();
300
+//type 1
301
+$mockFunction->add('date','2011');
302
303
+//type 2
304
+$mockFunction->add('date',function (){
305
+ return '2011'
306
+});
307
+```
308
### Scope management
309
Sometimes we may want to use mock function for objects. Here is an example; we can determine the scope area with the scope method.
310
```php
0 commit comments