mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
refactor
This commit is contained in:
@@ -6,7 +6,6 @@ use App\Users\Models\User;
|
||||
use Domain\Files\Models\File;
|
||||
use Domain\Sharing\Models\Share;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
|
||||
class DefaultRestrictionsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\App\Socialite;
|
||||
namespace Tests\App\Socialite;
|
||||
|
||||
use DB;
|
||||
use Storage;
|
||||
use Tests\TestCase;
|
||||
use App\Users\Models\User;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Socialite\Two\FacebookProvider;
|
||||
use Laravel\Socialite\Contracts\Factory as Socialite;
|
||||
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class SocialiteTest extends TestCase
|
||||
{
|
||||
/**
|
||||
@@ -29,7 +26,7 @@ class SocialiteTest extends TestCase
|
||||
* @test
|
||||
*/
|
||||
public function it_socialite_callback()
|
||||
{
|
||||
{
|
||||
// Set default settings
|
||||
DB::table('settings')->insert([
|
||||
[
|
||||
@@ -38,7 +35,7 @@ class SocialiteTest extends TestCase
|
||||
], [
|
||||
'name' => 'storage_default',
|
||||
'value' => 5,
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
// Create fake image
|
||||
@@ -73,7 +70,8 @@ class SocialiteTest extends TestCase
|
||||
// Replace Socialite Instance with mock
|
||||
$this->app->instance(Socialite::class, $stub);
|
||||
|
||||
$this->getJson('/api/socialite/facebook/callback');
|
||||
$this->getJson('/api/socialite/facebook/callback')
|
||||
->assertCreated();
|
||||
|
||||
$this
|
||||
->assertDatabaseHas('users', [
|
||||
@@ -89,7 +87,7 @@ class SocialiteTest extends TestCase
|
||||
|
||||
collect(config('vuefilemanager.avatar_sizes'))
|
||||
->each(
|
||||
fn($size) => Storage::disk('local')
|
||||
fn ($size) => Storage::disk('local')
|
||||
->assertExists("avatars/{$size['name']}-{$user->settings->getRawOriginal('avatar')}")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,8 +147,8 @@ class SettingsTest extends TestCase
|
||||
->actingAs($admin)
|
||||
->post('/api/admin/settings/payment-service', [
|
||||
'service' => 'stripe',
|
||||
'key' => '123456789',
|
||||
'secret' => '123456789',
|
||||
'key' => '123456789',
|
||||
'secret' => '123456789',
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseHas('settings', [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\Sharing;
|
||||
|
||||
use Tests\TestCase;
|
||||
@@ -193,7 +192,7 @@ class VisitorBrowseTest extends TestCase
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (!$is_protected) {
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/folders/$root->id/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
@@ -308,7 +307,7 @@ class VisitorBrowseTest extends TestCase
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (!$is_protected) {
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/navigation/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson($tree);
|
||||
@@ -360,7 +359,7 @@ class VisitorBrowseTest extends TestCase
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (!$is_protected) {
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
@@ -411,7 +410,7 @@ class VisitorBrowseTest extends TestCase
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (!$is_protected) {
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([]);
|
||||
@@ -458,7 +457,7 @@ class VisitorBrowseTest extends TestCase
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (!$is_protected) {
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/file/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
|
||||
Reference in New Issue
Block a user