Im learning how to use mockery in order to run some unit test and Im not sure what to do to mock my database class. It consists of separate methods that can be chained like
If you are happy with a syntax like this
$db = m::stub('Database', array(
'select(someTblName)->where(fieldName,someValue)->runQuery->fetch' => 'return stuff',
'select(someOtherTblName)->where(...)->runQuery->fetch' => 'return other stuff'
));
you can use a small Mockery helper/extension I've just written
https://github.com/elvisciotti/mockery-stub-chain-args
alpha version, I'll probably improve it soon