From 18150cd92037f2fe71c4dda0f08bb04ae5a89162 Mon Sep 17 00:00:00 2001 From: Peter Papp Date: Sun, 18 Jul 2021 14:53:00 +0200 Subject: [PATCH] test folder refactoring --- .../Users}/PersonalAccessTokenTest.php | 0 .../Users/SignFlowTest.php} | 23 +------------------ .../Users}/UserAccountTest.php | 23 ++++++++++++++++++- tests/{Feature => Domain}/Admin/AdminTest.php | 0 .../Browsing}/BrowseTest.php | 0 .../Files}/ContentAccessTest.php | 0 .../FileManager => Domain/Files}/FileTest.php | 0 .../Folders}/FolderTest.php | 0 .../Homepage/HomepageTest.php} | 2 +- .../Languages/LanguagesTest.php} | 2 +- .../Maintenance}/AppUpgradeTest.php | 0 .../SetupWizard}/SetupServiceTest.php | 0 .../SetupWizard}/SetupWizardTest.php | 0 .../Sharing}/UserShareTest.php | 0 .../Sharing}/VisitorAccessToItemsTest.php | 0 .../Sharing}/VisitorBrowseTest.php | 0 .../Sharing}/VisitorManipulatingTest.php | 0 .../Subscriptions}/SubscriptionTest.php | 0 .../Trash}/TrashTest.php | 0 .../Scheduler}/SchedulerTest.php | 0 20 files changed, 25 insertions(+), 25 deletions(-) rename tests/{Feature/Accounts => App/Users}/PersonalAccessTokenTest.php (100%) rename tests/{Feature/Accounts/AuthTest.php => App/Users/SignFlowTest.php} (88%) rename tests/{Feature/Accounts => App/Users}/UserAccountTest.php (91%) rename tests/{Feature => Domain}/Admin/AdminTest.php (100%) rename tests/{Feature/FileManager => Domain/Browsing}/BrowseTest.php (100%) rename tests/{Feature/FileManager => Domain/Files}/ContentAccessTest.php (100%) rename tests/{Feature/FileManager => Domain/Files}/FileTest.php (100%) rename tests/{Feature/FileManager => Domain/Folders}/FolderTest.php (100%) rename tests/{Feature/App/AppTest.php => Domain/Homepage/HomepageTest.php} (99%) rename tests/{Feature/Admin/LanguageEditorTest.php => Domain/Languages/LanguagesTest.php} (99%) rename tests/{Feature/App => Domain/Maintenance}/AppUpgradeTest.php (100%) rename tests/{Feature/Setup => Domain/SetupWizard}/SetupServiceTest.php (100%) rename tests/{Feature/Setup => Domain/SetupWizard}/SetupWizardTest.php (100%) rename tests/{Feature/Share => Domain/Sharing}/UserShareTest.php (100%) rename tests/{Feature/Share => Domain/Sharing}/VisitorAccessToItemsTest.php (100%) rename tests/{Feature/Share => Domain/Sharing}/VisitorBrowseTest.php (100%) rename tests/{Feature/Share => Domain/Sharing}/VisitorManipulatingTest.php (100%) rename tests/{Feature/External => Domain/Subscriptions}/SubscriptionTest.php (100%) rename tests/{Feature/FileManager => Domain/Trash}/TrashTest.php (100%) rename tests/{Feature/App => Support/Scheduler}/SchedulerTest.php (100%) diff --git a/tests/Feature/Accounts/PersonalAccessTokenTest.php b/tests/App/Users/PersonalAccessTokenTest.php similarity index 100% rename from tests/Feature/Accounts/PersonalAccessTokenTest.php rename to tests/App/Users/PersonalAccessTokenTest.php diff --git a/tests/Feature/Accounts/AuthTest.php b/tests/App/Users/SignFlowTest.php similarity index 88% rename from tests/Feature/Accounts/AuthTest.php rename to tests/App/Users/SignFlowTest.php index f852239b..e09b404d 100644 --- a/tests/Feature/Accounts/AuthTest.php +++ b/tests/App/Users/SignFlowTest.php @@ -12,29 +12,8 @@ use Notification; use Storage; 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 */ diff --git a/tests/Feature/Accounts/UserAccountTest.php b/tests/App/Users/UserAccountTest.php similarity index 91% rename from tests/Feature/Accounts/UserAccountTest.php rename to tests/App/Users/UserAccountTest.php index 9fd06630..15282f5a 100644 --- a/tests/Feature/Accounts/UserAccountTest.php +++ b/tests/App/Users/UserAccountTest.php @@ -16,7 +16,28 @@ class UserAccountTest extends TestCase public function __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); } /** diff --git a/tests/Feature/Admin/AdminTest.php b/tests/Domain/Admin/AdminTest.php similarity index 100% rename from tests/Feature/Admin/AdminTest.php rename to tests/Domain/Admin/AdminTest.php diff --git a/tests/Feature/FileManager/BrowseTest.php b/tests/Domain/Browsing/BrowseTest.php similarity index 100% rename from tests/Feature/FileManager/BrowseTest.php rename to tests/Domain/Browsing/BrowseTest.php diff --git a/tests/Feature/FileManager/ContentAccessTest.php b/tests/Domain/Files/ContentAccessTest.php similarity index 100% rename from tests/Feature/FileManager/ContentAccessTest.php rename to tests/Domain/Files/ContentAccessTest.php diff --git a/tests/Feature/FileManager/FileTest.php b/tests/Domain/Files/FileTest.php similarity index 100% rename from tests/Feature/FileManager/FileTest.php rename to tests/Domain/Files/FileTest.php diff --git a/tests/Feature/FileManager/FolderTest.php b/tests/Domain/Folders/FolderTest.php similarity index 100% rename from tests/Feature/FileManager/FolderTest.php rename to tests/Domain/Folders/FolderTest.php diff --git a/tests/Feature/App/AppTest.php b/tests/Domain/Homepage/HomepageTest.php similarity index 99% rename from tests/Feature/App/AppTest.php rename to tests/Domain/Homepage/HomepageTest.php index 322df023..f4ab956c 100644 --- a/tests/Feature/App/AppTest.php +++ b/tests/Domain/Homepage/HomepageTest.php @@ -13,7 +13,7 @@ use Mail; use ScssPhp\ScssPhp\Compiler; use Tests\TestCase; -class AppTest extends TestCase +class HomepageTest extends TestCase { public function __construct() { diff --git a/tests/Feature/Admin/LanguageEditorTest.php b/tests/Domain/Languages/LanguagesTest.php similarity index 99% rename from tests/Feature/Admin/LanguageEditorTest.php rename to tests/Domain/Languages/LanguagesTest.php index 00485d2d..5d7bc47f 100644 --- a/tests/Feature/Admin/LanguageEditorTest.php +++ b/tests/Domain/Languages/LanguagesTest.php @@ -9,7 +9,7 @@ use App\Services\SetupService; use Laravel\Sanctum\Sanctum; use Tests\TestCase; -class LanguageEditorTest extends TestCase +class LanguagesTest extends TestCase { protected $setup; diff --git a/tests/Feature/App/AppUpgradeTest.php b/tests/Domain/Maintenance/AppUpgradeTest.php similarity index 100% rename from tests/Feature/App/AppUpgradeTest.php rename to tests/Domain/Maintenance/AppUpgradeTest.php diff --git a/tests/Feature/Setup/SetupServiceTest.php b/tests/Domain/SetupWizard/SetupServiceTest.php similarity index 100% rename from tests/Feature/Setup/SetupServiceTest.php rename to tests/Domain/SetupWizard/SetupServiceTest.php diff --git a/tests/Feature/Setup/SetupWizardTest.php b/tests/Domain/SetupWizard/SetupWizardTest.php similarity index 100% rename from tests/Feature/Setup/SetupWizardTest.php rename to tests/Domain/SetupWizard/SetupWizardTest.php diff --git a/tests/Feature/Share/UserShareTest.php b/tests/Domain/Sharing/UserShareTest.php similarity index 100% rename from tests/Feature/Share/UserShareTest.php rename to tests/Domain/Sharing/UserShareTest.php diff --git a/tests/Feature/Share/VisitorAccessToItemsTest.php b/tests/Domain/Sharing/VisitorAccessToItemsTest.php similarity index 100% rename from tests/Feature/Share/VisitorAccessToItemsTest.php rename to tests/Domain/Sharing/VisitorAccessToItemsTest.php diff --git a/tests/Feature/Share/VisitorBrowseTest.php b/tests/Domain/Sharing/VisitorBrowseTest.php similarity index 100% rename from tests/Feature/Share/VisitorBrowseTest.php rename to tests/Domain/Sharing/VisitorBrowseTest.php diff --git a/tests/Feature/Share/VisitorManipulatingTest.php b/tests/Domain/Sharing/VisitorManipulatingTest.php similarity index 100% rename from tests/Feature/Share/VisitorManipulatingTest.php rename to tests/Domain/Sharing/VisitorManipulatingTest.php diff --git a/tests/Feature/External/SubscriptionTest.php b/tests/Domain/Subscriptions/SubscriptionTest.php similarity index 100% rename from tests/Feature/External/SubscriptionTest.php rename to tests/Domain/Subscriptions/SubscriptionTest.php diff --git a/tests/Feature/FileManager/TrashTest.php b/tests/Domain/Trash/TrashTest.php similarity index 100% rename from tests/Feature/FileManager/TrashTest.php rename to tests/Domain/Trash/TrashTest.php diff --git a/tests/Feature/App/SchedulerTest.php b/tests/Support/Scheduler/SchedulerTest.php similarity index 100% rename from tests/Feature/App/SchedulerTest.php rename to tests/Support/Scheduler/SchedulerTest.php