Last active
January 18, 2022 00:14
-
-
Save xbot/d0ace9c1ebdb161adf229c9a9c62f2bf to your computer and use it in GitHub Desktop.
How to mock laravel DB facade。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB::shouldReceive('table')->with('users as u')->once()->andReturnSelf(); | |
DB::shouldReceive('where')->with('u.id', $user->id)->once()->andReturnSelf(); | |
DB::shouldReceive('value')->with('u.favorites_shortages')->once()->andReturn($fakeOldShortages); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment