Commit aeb184eb authored by Viral Solani's avatar Viral Solani

add helper function for test create user

parent 114caa06
<?php
namespace Tests;
use App\Models\Access\User\User;
trait CreatesUsers
{
protected function login(array $attributes = []): User
{
$user = $this->createUser($attributes);
$this->be($user);
return $user;
}
protected function createUser(array $attributes = []): User
{
return factory(User::class)->create(array_merge([
'name' => 'John Doe',
'username' => 'johndoe',
'email' => 'john@example.com',
'password' => bcrypt('password'),
'github_username' => 'johndoe',
], $attributes));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment