You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
875 B

<?php
use App\Entities\Users\Role;
use App\Entities\Users\User;
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://localhost';
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
\Hash::setRounds(5);
return $app;
}
protected function adminUserSigningIn()
{
factory(Role::class)->create(['name' => 'admin']);
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
return $user;
}
}