2017-07-11 20:37:02 -07:00
|
|
|
<?php
|
2017-08-31 11:14:21 -07:00
|
|
|
use App\Models\User;
|
2017-07-11 20:37:02 -07:00
|
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
|
|
|
|
|
|
class BaseTest extends \Codeception\TestCase\Test
|
|
|
|
{
|
|
|
|
use DatabaseTransactions;
|
|
|
|
protected function _before()
|
|
|
|
{
|
|
|
|
Artisan::call('migrate');
|
|
|
|
factory(App\Models\Setting::class)->create();
|
|
|
|
}
|
2017-08-31 11:14:21 -07:00
|
|
|
|
|
|
|
protected function signIn($user = null)
|
|
|
|
{
|
|
|
|
if (!$user) {
|
|
|
|
$user = factory(User::class)->states('superuser')->create();
|
|
|
|
}
|
|
|
|
Auth::login($user);
|
|
|
|
|
|
|
|
return $user;
|
|
|
|
}
|
2017-07-11 20:37:02 -07:00
|
|
|
}
|