Last active
May 7, 2017 15:50
-
-
Save MEGApixel23/576237544b1c82e17d7255abbb47f6a6 to your computer and use it in GitHub Desktop.
Example of a partial class mock (only needed method will be mocked, others stays unchanged).
This file contains hidden or 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
<?php | |
$mock = Mockery::mock(ClassYouWantToMock::class)->makePartial(); | |
$mock->shouldReceive('methodNameToMock')->andReturn($returnVariable); | |
$this->app->instance(ClassYouWantToMock::class, $mock); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment