|
|
|
|
|
by mattsah
4899 days ago
|
|
Expectations and responses (provided by give()) are actually held internally. Your syntax is cleaner for very simple responses, however will become increasingly complex, particularly when the response itself is determined by a callback. Adding more params would clutter your example terribly. Also, the mime's are passed to callbacks which provide response so that additional functionality can be added, see this recent use-case: Parody\Mime::create('App\Text')
-> onCall('create') -> expect('WTF' . DS . 'Yo') -> give(function($mime) {
return $mime
-> onCall('underscorize') -> give('wtf' . DS . 'yo')
-> resolve();
}); |
|
https://github.com/dotink/inKWellToo/blob/master/external/te...