Jsonified Ini Notation
github.com2 pointsby mattsah0 comments
Mime::create('Vendor\Project\Class')
->onCall('method1')->expect('arg1', 2)->give(function($mime) {
$mime->onGet('property1')->give('totally');
$mime->onGet('property2')->give('possible');
return $mime;
})
->onCall('method2')->give(function($mime) {
$mime->onGet('property1')->give('new value');
return TRUE;
});
I am not readily familiar with the syntax of other frameworks... but this seems a lot more flexible than passing arguments to the callback and forcing untested logic into the callbacks.
Hit ctrl+s to save.