mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
PersonalAccessTokenTest refactoring
This commit is contained in:
@@ -6,7 +6,6 @@ use App\Models\Setting;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications\ResetPassword;
|
use App\Notifications\ResetPassword;
|
||||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Support\Facades\Password;
|
use Illuminate\Support\Facades\Password;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Notification;
|
use Notification;
|
||||||
@@ -15,8 +14,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class AuthTest extends TestCase
|
class AuthTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tests\Feature\Accounts;
|
||||||
|
|
||||||
|
use App\Models\File;
|
||||||
|
use App\Models\Folder;
|
||||||
|
use App\Models\User;
|
||||||
|
use Laravel\Sanctum\Sanctum;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class PersonalAccessTokenTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_create_user_token()
|
||||||
|
{
|
||||||
|
$user = User::factory(User::class)
|
||||||
|
->create();
|
||||||
|
|
||||||
|
Sanctum::actingAs($user);
|
||||||
|
|
||||||
|
$this->postJson('/api/user/token/create', [
|
||||||
|
'name' => 'token',
|
||||||
|
])->assertStatus(201);
|
||||||
|
|
||||||
|
$this->assertDatabaseHas('personal_access_tokens', [
|
||||||
|
'tokenable_id' => $user->id,
|
||||||
|
'name' => 'token',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_revoke_user_token()
|
||||||
|
{
|
||||||
|
$user = User::factory(User::class)
|
||||||
|
->create();
|
||||||
|
|
||||||
|
Sanctum::actingAs($user);
|
||||||
|
|
||||||
|
$user->createToken('token');
|
||||||
|
|
||||||
|
$token_id = $user->tokens()->first()->id;
|
||||||
|
|
||||||
|
$this->deleteJson("/api/user/token/revoke/$token_id")
|
||||||
|
->assertStatus(204);
|
||||||
|
|
||||||
|
$this->assertDatabaseMissing('personal_access_tokens', [
|
||||||
|
'id' => $token_id,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_user_tokens()
|
||||||
|
{
|
||||||
|
$user = User::factory(User::class)
|
||||||
|
->create();
|
||||||
|
|
||||||
|
$user->createToken('token');
|
||||||
|
|
||||||
|
$token = $user->tokens()->first();
|
||||||
|
|
||||||
|
$this
|
||||||
|
->actingAs($user)
|
||||||
|
->getJson('/api/user/tokens')
|
||||||
|
->assertStatus(200)
|
||||||
|
->assertJsonFragment([
|
||||||
|
'id' => $token->id,
|
||||||
|
'tokenable_type' => $token->tokenable_type,
|
||||||
|
'tokenable_id' => $user->id,
|
||||||
|
'name' => $token->name,
|
||||||
|
'abilities' => $token->abilities,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_use_user_token_in_public_api_request()
|
||||||
|
{
|
||||||
|
$user = User::factory(User::class)
|
||||||
|
->create();
|
||||||
|
|
||||||
|
$folder = Folder::factory(Folder::class)
|
||||||
|
->create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$file = File::factory(File::class)
|
||||||
|
->create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'folder_id' => $folder->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$token = $user->createToken('token')->plainTextToken;
|
||||||
|
|
||||||
|
$this->assertDatabaseHas('personal_access_tokens', [
|
||||||
|
'tokenable_id' => $user->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertDatabaseHas('folders', [
|
||||||
|
'id' => $folder->id,
|
||||||
|
'user_id' => $user->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this
|
||||||
|
->withToken($token)
|
||||||
|
->getJson("/api/browse/folders/$folder->id")
|
||||||
|
->assertOk()
|
||||||
|
->assertJsonFragment([
|
||||||
|
'id' => $file->id,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,20 +4,15 @@ namespace Tests\Feature\Accounts;
|
|||||||
use Storage;
|
use Storage;
|
||||||
use Notification;
|
use Notification;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use App\Models\File;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Folder;
|
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
|
|
||||||
class UserAccountTest extends TestCase
|
class UserAccountTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
@@ -153,112 +148,6 @@ class UserAccountTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function it_create_user_token()
|
|
||||||
{
|
|
||||||
$user = User::factory(User::class)
|
|
||||||
->create();
|
|
||||||
|
|
||||||
Sanctum::actingAs($user);
|
|
||||||
|
|
||||||
$this->postJson('/api/user/token/create', [
|
|
||||||
'name' => 'token',
|
|
||||||
])->assertStatus(201);
|
|
||||||
|
|
||||||
$this->assertDatabaseHas('personal_access_tokens', [
|
|
||||||
'tokenable_id' => $user->id,
|
|
||||||
'name' => 'token',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function it_revoke_user_token()
|
|
||||||
{
|
|
||||||
$user = User::factory(User::class)
|
|
||||||
->create();
|
|
||||||
|
|
||||||
Sanctum::actingAs($user);
|
|
||||||
|
|
||||||
$user->createToken('token');
|
|
||||||
|
|
||||||
$token_id = $user->tokens()->first()->id;
|
|
||||||
|
|
||||||
$this->deleteJson("/api/user/token/revoke/$token_id")
|
|
||||||
->assertStatus(204);
|
|
||||||
|
|
||||||
$this->assertDatabaseMissing('personal_access_tokens', [
|
|
||||||
'id' => $token_id,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function it_get_user_tokens()
|
|
||||||
{
|
|
||||||
$user = User::factory(User::class)
|
|
||||||
->create();
|
|
||||||
|
|
||||||
$user->createToken('token');
|
|
||||||
|
|
||||||
$token = $user->tokens()->first();
|
|
||||||
|
|
||||||
$this
|
|
||||||
->actingAs($user)
|
|
||||||
->getJson('/api/user/tokens')
|
|
||||||
->assertStatus(200)
|
|
||||||
->assertJsonFragment([
|
|
||||||
'id' => $token->id,
|
|
||||||
'tokenable_type' => $token->tokenable_type,
|
|
||||||
'tokenable_id' => $user->id,
|
|
||||||
'name' => $token->name,
|
|
||||||
'abilities' => $token->abilities,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function it_use_user_token_in_public_api_request()
|
|
||||||
{
|
|
||||||
$user = User::factory(User::class)
|
|
||||||
->create();
|
|
||||||
|
|
||||||
$folder = Folder::factory(Folder::class)
|
|
||||||
->create([
|
|
||||||
'user_id' => $user->id,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$file = File::factory(File::class)
|
|
||||||
->create([
|
|
||||||
'user_id' => $user->id,
|
|
||||||
'folder_id' => $folder->id,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$token = $user->createToken('token')->plainTextToken;
|
|
||||||
|
|
||||||
$this->assertDatabaseHas('personal_access_tokens', [
|
|
||||||
'tokenable_id' => $user->id,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertDatabaseHas('folders', [
|
|
||||||
'id' => $folder->id,
|
|
||||||
'user_id' => $user->id,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this
|
|
||||||
->withToken($token)
|
|
||||||
->getJson("/api/browse/folders/$folder->id")
|
|
||||||
->assertOk()
|
|
||||||
->assertJsonFragment([
|
|
||||||
'id' => $file->id,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ use App\Models\Zip;
|
|||||||
use App\Notifications\ResetPassword;
|
use App\Notifications\ResetPassword;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use DB;
|
use DB;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Notification;
|
use Notification;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
@@ -20,8 +19,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class AdminTest extends TestCase
|
class AdminTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -6,14 +6,11 @@ use App\Models\Language;
|
|||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class LanguageEditorTest extends TestCase
|
class LanguageEditorTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
protected $setup;
|
protected $setup;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|||||||
@@ -9,15 +9,12 @@ use App\Models\Setting;
|
|||||||
use App\Models\Share;
|
use App\Models\Share;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Mail;
|
use Mail;
|
||||||
use ScssPhp\ScssPhp\Compiler;
|
use ScssPhp\ScssPhp\Compiler;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class AppTest extends TestCase
|
class AppTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -2,18 +2,14 @@
|
|||||||
|
|
||||||
namespace Tests\Feature\App;
|
namespace Tests\Feature\App;
|
||||||
|
|
||||||
use App\Models\LanguageTranslation;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use DB;
|
use DB;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class AppUpgradeTest extends TestCase
|
class AppUpgradeTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -7,15 +7,12 @@ use App\Models\User;
|
|||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use App\Services\SchedulerService;
|
use App\Services\SchedulerService;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Storage;
|
use Storage;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class SchedulerTest extends TestCase
|
class SchedulerTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
-4
@@ -3,16 +3,12 @@
|
|||||||
namespace Tests\Feature\External;
|
namespace Tests\Feature\External;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class SubscriptionTest extends TestCase
|
class SubscriptionTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
private $plan;
|
private $plan;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use App\Models\File;
|
|||||||
use App\Models\Folder;
|
use App\Models\Folder;
|
||||||
use App\Models\Share;
|
use App\Models\Share;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ use App\Models\File;
|
|||||||
use App\Models\Folder;
|
use App\Models\Folder;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@@ -17,8 +15,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class ContentAccessTest extends TestCase
|
class ContentAccessTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use App\Models\Setting;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Storage;
|
use Storage;
|
||||||
@@ -16,8 +15,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class FileTest extends TestCase
|
class FileTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use App\Models\Folder;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Storage;
|
use Storage;
|
||||||
@@ -17,8 +16,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class FolderTest extends TestCase
|
class FolderTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ use App\Models\File;
|
|||||||
use App\Models\Folder;
|
use App\Models\Folder;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Storage;
|
use Storage;
|
||||||
@@ -15,8 +13,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class TrashTest extends TestCase
|
class TrashTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -3,17 +3,13 @@
|
|||||||
namespace Tests\Feature\Setup;
|
namespace Tests\Feature\Setup;
|
||||||
|
|
||||||
use App\Models\Language;
|
use App\Models\Language;
|
||||||
use App\Models\LanguageTranslation;
|
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Storage;
|
use Storage;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class SetupServiceTest extends TestCase
|
class SetupServiceTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace Tests\Feature\Setup;
|
|||||||
|
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
@@ -12,8 +11,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class SetupWizardTest extends TestCase
|
class SetupWizardTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CAVEAT:
|
* CAVEAT:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,20 +4,14 @@ namespace Tests\Feature\Share;
|
|||||||
|
|
||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use App\Models\Folder;
|
use App\Models\Folder;
|
||||||
use App\Models\Share;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications\SharedSendViaEmail;
|
use App\Notifications\SharedSendViaEmail;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
use Illuminate\Foundation\Testing\WithFaker;
|
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Laravel\Sanctum\Sanctum;
|
use Laravel\Sanctum\Sanctum;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class UserShareTest extends TestCase
|
class UserShareTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,17 +7,13 @@ use App\Models\Share;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Facades\Cookie;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Storage;
|
use Storage;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class VisitorAccessToItemsTest extends TestCase
|
class VisitorAccessToItemsTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
private $setup;
|
private $setup;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ use App\Models\Folder;
|
|||||||
use App\Models\Share;
|
use App\Models\Share;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Zip;
|
use App\Models\Zip;
|
||||||
use Hash;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@@ -17,8 +15,6 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class VisitorBrowseTest extends TestCase
|
class VisitorBrowseTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -7,15 +7,12 @@ use App\Models\Folder;
|
|||||||
use App\Models\Share;
|
use App\Models\Share;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\SetupService;
|
use App\Services\SetupService;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Storage;
|
use Storage;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class VisitorManipulatingTest extends TestCase
|
class VisitorManipulatingTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace Tests;
|
namespace Tests;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
@@ -10,6 +11,7 @@ use Illuminate\Support\Facades\Storage;
|
|||||||
abstract class TestCase extends BaseTestCase
|
abstract class TestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
use CreatesApplication;
|
use CreatesApplication;
|
||||||
|
use DatabaseMigrations;
|
||||||
|
|
||||||
public function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user