Created
May 6, 2020 06:45
-
-
Save Sankame/c19a7080ea1ca8a2bfe7a6655cc181ac to your computer and use it in GitHub Desktop.
Sample code using Laravel, PHPUnit and Mockery
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
/** | |
* @runInSeparateProcess | |
* @preserveGlobalState disabled | |
*/ | |
public function testEditWhenRecordNotFound() | |
{ | |
$this->mock = M::mock('alias:App\Contact')->makePartial(); | |
$this->mock->shouldReceive('find')->once()->with(self::ID)->andReturnUsing(function(){ | |
return null; | |
}); | |
$response = $this->get('/contacts/' . self::ID . '/edit'); | |
$response->assertRedirect('/contacts'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment