You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using laravel with mockery to unit test my queries.. how can I mock the when method of laravel db query using mockery? so here is what I want to test..
/** * A basic test example. * * @return void */publicfunctiontest_example()
{
DB::shouldReceive('table')->once()->with('users')->andReturnSelf();
DB::shouldReceive('get')->once()->andReturn(collect(newUser()));
(newTestRepo())->testQb();
$this->assertTrue(true);
}
the only missing on this test is the part where the when method is being called. is this possible to mock also on mockery? and how can I do that? thanks in advance
The text was updated successfully, but these errors were encountered:
Hi,
I am using laravel with mockery to unit test my queries.. how can I mock the
when
method of laravel db query using mockery? so here is what I want to test..and here is what my test look like..
the only missing on this test is the part where the
when
method is being called. is this possible to mock also on mockery? and how can I do that? thanks in advanceThe text was updated successfully, but these errors were encountered: