Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Tests\Feature;
- use Tests\TestCase;
- use Illuminate\Foundation\Testing\WithFaker;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- use App\User;
- class TestAuthentication extends TestCase
- {
- use RefreshDatabase;
- public $testUser = [
- 'name' => 'tester engineering',
- 'email' => 'test@cmu.ac.th'
- ];
- public function setUp()
- {
- parent::setUp();
- $this->artisan("db:seed");
- User::create($this->testUser);
- }
- public function authenticated()
- {
- $user = User::where('email', $this->testUser['email'])->first();
- return $this->actingAs($user);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement