test groups refactoring

This commit is contained in:
Peter Papp
2021-07-18 16:53:12 +02:00
parent 18150cd920
commit a1778eab52
83 changed files with 1482 additions and 1421 deletions

View File

@@ -2,9 +2,9 @@
namespace Tests\Feature\Accounts;
use App\Models\File;
use App\Models\Folder;
use App\Models\User;
use Domain\Settings\Models\File;
use Domain\Settings\Models\Folder;
use Domain\Settings\Models\User;
use Tests\TestCase;
class PersonalAccessTokenTest extends TestCase

View File

@@ -2,8 +2,8 @@
namespace Tests\Feature\Accounts;
use App\Models\Setting;
use App\Models\User;
use Domain\Settings\Models\Setting;
use Domain\Settings\Models\User;
use App\Notifications\ResetPassword;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Support\Facades\Password;
@@ -107,9 +107,9 @@ class SignFlowTest extends TestCase
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$this->postJson('/logout')
$this
->actingAs($user)
->postJson('/logout')
->assertStatus(204);
}

View File

@@ -4,9 +4,9 @@ namespace Tests\Feature\Accounts;
use Storage;
use Notification;
use Tests\TestCase;
use App\Models\User;
use Domain\Settings\Models\User;
use Laravel\Sanctum\Sanctum;
use App\Services\SetupService;
use Domain\SetupWizard\Services\SetupService;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\URL;
use Illuminate\Auth\Notifications\VerifyEmail;
@@ -48,9 +48,9 @@ class UserAccountTest extends TestCase
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$this->postJson('/api/user/password', [
$this
->actingAs($user)
->postJson('/api/user/password', [
'current_password' => 'secret',
'password' => 'VerySecretPassword',
'password_confirmation' => 'VerySecretPassword',
@@ -67,9 +67,9 @@ class UserAccountTest extends TestCase
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$this->patchJson('/api/user/relationships/settings', [
$this
->actingAs($user)
->patchJson('/api/user/relationships/settings', [
'name' => 'address',
'value' => 'Jantar',
])->assertStatus(204);
@@ -84,17 +84,15 @@ class UserAccountTest extends TestCase
*/
public function it_update_user_avatar()
{
$this->setup->create_directories();
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$avatar = UploadedFile::fake()
->image('fake-image.jpg');
$this->patchJson('/api/user/relationships/settings', [
$this
->actingAs($user)
->patchJson('/api/user/relationships/settings', [
'avatar' => $avatar,
])->assertStatus(204);