Skip to content

Instantly share code, notes, and snippets.

@phanlyhuynh
Created October 14, 2020 04:32
Show Gist options
  • Save phanlyhuynh/735f8f1872e7ae6c0b224b6e55712507 to your computer and use it in GitHub Desktop.
Save phanlyhuynh/735f8f1872e7ae6c0b224b6e55712507 to your computer and use it in GitHub Desktop.
Unit test: pass authorize
$mock = Mockery::mock(Illuminate\Contracts\Auth\Access\Gate::class);
$mock->shouldReceive('authorize')->once()->andReturn(true);
$mock->shouldReceive('allows')->once()->andReturn(true);
$this->app[Gate::class] = $mock;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment