Mocking with Mockery

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 these two examples:

   ->where('fieldName', 'someValue')
   ->fetch(); //returns array or null

Another use could be like:

   ->where('fieldName', 'someValue')
   ->where('fieldName', array('>=' , 'someValue')
   ->fetch(); //returns array or null

From reading some of the documentation I see that I can do something like:(for the first case)

$db = \\Mockery::mock('Database');
$db->shouldReceive('select', 'where', 'runQuery', 'fetcth')

Now Im interested on how to pass the “corresponting” parameters to the methods? And, how would I mock the second scenario.

According to the documentation, you should be able to do something like this:

$mock = \\Mockery::mock('Database');

So omit the


all together?