test folder refactoring

This commit is contained in:
Peter Papp
2021-07-18 14:53:00 +02:00
parent 5046071f3a
commit 18150cd920
20 changed files with 25 additions and 25 deletions

View File

@@ -12,29 +12,8 @@ use Notification;
use Storage; use Storage;
use Tests\TestCase; use Tests\TestCase;
class AuthTest extends TestCase class SignFlowTest extends TestCase
{ {
/**
* @test
*/
public function it_generate_and_store_user()
{
$user = User::factory(User::class)
->create(['role' => 'user']);
$this->assertDatabaseHas('users', [
'id' => $user->id,
'role' => 'user',
]);
$this->assertDatabaseHas('user_settings', [
'user_id' => $user->id,
]);
Storage::disk('local')
->assertExists('files/' . User::first()->id);
}
/** /**
* @test * @test
*/ */

View File

@@ -16,7 +16,28 @@ class UserAccountTest extends TestCase
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->setup = app()->make(SetupService::class); $this->setup = resolve(SetupService::class);
}
/**
* @test
*/
public function it_generate_and_store_user()
{
$user = User::factory(User::class)
->create(['role' => 'user']);
$this->assertDatabaseHas('users', [
'id' => $user->id,
'role' => 'user',
]);
$this->assertDatabaseHas('user_settings', [
'user_id' => $user->id,
]);
Storage::disk('local')
->assertExists('files/' . User::first()->id);
} }
/** /**

View File

@@ -13,7 +13,7 @@ use Mail;
use ScssPhp\ScssPhp\Compiler; use ScssPhp\ScssPhp\Compiler;
use Tests\TestCase; use Tests\TestCase;
class AppTest extends TestCase class HomepageTest extends TestCase
{ {
public function __construct() public function __construct()
{ {

View File

@@ -9,7 +9,7 @@ use App\Services\SetupService;
use Laravel\Sanctum\Sanctum; use Laravel\Sanctum\Sanctum;
use Tests\TestCase; use Tests\TestCase;
class LanguageEditorTest extends TestCase class LanguagesTest extends TestCase
{ {
protected $setup; protected $setup;