Skip to content

Instantly share code, notes, and snippets.

@JuanVqz
Last active May 6, 2018 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JuanVqz/f65fd3da98741b5e2a0bc50342f8c42b to your computer and use it in GitHub Desktop.
Save JuanVqz/f65fd3da98741b5e2a0bc50342f8c42b to your computer and use it in GitHub Desktop.
TestCase.php with signIn method 2
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected function signIn($user = null) {
$user = $user ?: create('App\User');
$this->actingAs('$user');
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment