Found the answer on stack overflow http://stackoverflow.com/questions/20701679/mocking-callbacks-in-laravel-4-mockery
I modified the mock code to the following
DB::shouldReceive('connection')
->once()
->with('remote_mysql')
->andReturn(Mockery::mock('Illuminate\Database\Connection', function ($mock) use ($returnTimestamp)
{
$mock->shouldReceive('select')
->once()
->with('SELECT UNIX_TIMESTAMP()')
->andReturn($returnTimestamp);
})
);
roberto0arruda liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community