mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
unit test fixes
This commit is contained in:
2
public/chunks/admin-account.js
vendored
2
public/chunks/admin-account.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/admin.js
vendored
2
public/chunks/admin.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/chunks/admin~chunks/settings.js
vendored
Normal file
1
public/chunks/admin~chunks/settings.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/chunks/app-appearance.js
vendored
2
public/chunks/app-appearance.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/chunks/app-billings.js
vendored
2
public/chunks/app-billings.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-email.js
vendored
2
public/chunks/app-email.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-index.js
vendored
2
public/chunks/app-index.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-language.js
vendored
2
public/chunks/app-language.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-others.js
vendored
2
public/chunks/app-others.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-payments.js
vendored
2
public/chunks/app-payments.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-settings.js
vendored
2
public/chunks/app-settings.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/app-setup.js
vendored
2
public/chunks/app-setup.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/billings-detail.js
vendored
2
public/chunks/billings-detail.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/contact-us.js
vendored
2
public/chunks/contact-us.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/create-new-password.js
vendored
2
public/chunks/create-new-password.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/dashboard.js
vendored
2
public/chunks/dashboard.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/database.js
vendored
2
public/chunks/database.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/dynamic-page.js
vendored
2
public/chunks/dynamic-page.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/email-verified.js
vendored
2
public/chunks/email-verified.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/environment-setup.js
vendored
2
public/chunks/environment-setup.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/files.js
vendored
2
public/chunks/files.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */
|
||||
File diff suppressed because one or more lines are too long
2
public/chunks/forgotten-password.js
vendored
2
public/chunks/forgotten-password.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/homepage.js
vendored
2
public/chunks/homepage.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/installation-disclaimer.js
vendored
2
public/chunks/installation-disclaimer.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/invoices.js
vendored
2
public/chunks/invoices.js
vendored
File diff suppressed because one or more lines are too long
1
public/chunks/my-shared-items.js
vendored
Normal file
1
public/chunks/my-shared-items.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/chunks/not-found.js
vendored
2
public/chunks/not-found.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/page-edit.js
vendored
2
public/chunks/page-edit.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/pages.js
vendored
2
public/chunks/pages.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plan-create.js
vendored
2
public/chunks/plan-create.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plan-delete.js
vendored
2
public/chunks/plan-delete.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plan-settings.js
vendored
2
public/chunks/plan-settings.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plan-subscribers.js
vendored
2
public/chunks/plan-subscribers.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plan.js
vendored
2
public/chunks/plan.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/plans.js
vendored
2
public/chunks/plans.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/platform.js
vendored
2
public/chunks/platform.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/profile.js
vendored
2
public/chunks/profile.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/chunks/purchase-code.js
vendored
2
public/chunks/purchase-code.js
vendored
File diff suppressed because one or more lines are too long
1
public/chunks/recent-uploads.js
vendored
Normal file
1
public/chunks/recent-uploads.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/chunks/settings-invoices.js
vendored
2
public/chunks/settings-invoices.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/settings-password.js
vendored
2
public/chunks/settings-password.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/settings-payment-methods.js
vendored
2
public/chunks/settings-payment-methods.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/settings-storage.js
vendored
2
public/chunks/settings-storage.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/settings-subscription.js
vendored
2
public/chunks/settings-subscription.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/settings.js
vendored
2
public/chunks/settings.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/setup-wizard.js
vendored
2
public/chunks/setup-wizard.js
vendored
@@ -1 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{oBQg:function(e,t,r){"use strict";r.r(t);var n=r("L2JU");function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i={name:"SetupWizard",computed:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},Object(n.b)(["config"])),mounted:function(){var e=this.$root.$data.config.installation;e&&"setup-done"===e&&this.$router.push({name:"SignIn"})}},u=r("KHd+"),a=Object(u.a)(i,(function(){var e=this.$createElement;return(this._self._c||e)("router-view")}),[],!1,null,null,null);t.default=a.exports}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{oBQg:function(e,t,r){"use strict";r.r(t);var n=r("L2JU");function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i={name:"SetupWizard",computed:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},Object(n.b)(["config"])),mounted:function(){var e=this.$root.$data.config.installation;e&&"setup-done"===e&&this.$router.push({name:"SignIn"})}},u=r("KHd+"),a=Object(u.a)(i,(function(){var e=this.$createElement;return(this._self._c||e)("router-view")}),[],!1,null,null,null);t.default=a.exports}}]);
|
||||
2
public/chunks/shared.js
vendored
2
public/chunks/shared.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/shared/authenticate.js
vendored
2
public/chunks/shared/authenticate.js
vendored
File diff suppressed because one or more lines are too long
1
public/chunks/shared/files.js
vendored
Normal file
1
public/chunks/shared/files.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/chunks/shared/single-file.js
vendored
2
public/chunks/shared/single-file.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/sign-in.js
vendored
2
public/chunks/sign-in.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/sign-up.js
vendored
2
public/chunks/sign-up.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/status-check.js
vendored
2
public/chunks/status-check.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/stripe-credentials.js
vendored
2
public/chunks/stripe-credentials.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/subscription-plans.js
vendored
2
public/chunks/subscription-plans.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/subscription-service.js
vendored
2
public/chunks/subscription-service.js
vendored
File diff suppressed because one or more lines are too long
1
public/chunks/team-folders.js
vendored
Normal file
1
public/chunks/team-folders.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
public/chunks/trash.js
vendored
6
public/chunks/trash.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/upgrade-billing.js
vendored
2
public/chunks/upgrade-billing.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/upgrade-plan.js
vendored
2
public/chunks/upgrade-plan.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-create.js
vendored
2
public/chunks/user-create.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-delete.js
vendored
2
public/chunks/user-delete.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-detail.js
vendored
2
public/chunks/user-detail.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-invoices.js
vendored
2
public/chunks/user-invoices.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-password.js
vendored
2
public/chunks/user-password.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-storage.js
vendored
2
public/chunks/user-storage.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user-subscription.js
vendored
2
public/chunks/user-subscription.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/user.js
vendored
2
public/chunks/user.js
vendored
File diff suppressed because one or more lines are too long
2
public/chunks/users.js
vendored
2
public/chunks/users.js
vendored
File diff suppressed because one or more lines are too long
2
public/css/app.css
vendored
2
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
2
public/js/main.js
vendored
2
public/js/main.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendors~chunks/admin~chunks/platform~chunks/settings~chunks/shared.js
vendored
Normal file
2
public/vendors~chunks/admin~chunks/platform~chunks/settings~chunks/shared.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */
|
||||
|
||||
/**
|
||||
* @licstart The following is the entire license notice for the
|
||||
* Javascript code in this page
|
||||
*
|
||||
* Copyright 2020 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @licend The above is the entire license notice for the
|
||||
* Javascript code in this page
|
||||
*/
|
||||
@@ -172,13 +172,7 @@ class UserAccountTest extends TestCase
|
||||
],
|
||||
],
|
||||
'favourites' => [
|
||||
'data' => [
|
||||
'id' => (string) $user->id,
|
||||
'type' => 'favourite_folders',
|
||||
'attributes' => [
|
||||
'folders' => [],
|
||||
],
|
||||
],
|
||||
'data' => [],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\Browsing;
|
||||
|
||||
use Tests\TestCase;
|
||||
@@ -59,8 +60,8 @@ class BrowseTest extends TestCase
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
[
|
||||
'name' => 'Files',
|
||||
'folders' => [
|
||||
'name' => 'Files',
|
||||
'folders' => [
|
||||
[
|
||||
'id' => $folder_level_1->id,
|
||||
'parent_id' => null,
|
||||
@@ -109,8 +110,8 @@ class BrowseTest extends TestCase
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'Team Folders',
|
||||
'folders' => [],
|
||||
'name' => 'Team Folders',
|
||||
'folders' => [],
|
||||
],
|
||||
]);
|
||||
}
|
||||
@@ -152,55 +153,14 @@ class BrowseTest extends TestCase
|
||||
->actingAs($user)
|
||||
->getJson("/api/browse/folders/$root->id")
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
[
|
||||
'id' => $folder->id,
|
||||
'user_id' => $user->id,
|
||||
'parent_id' => $root->id,
|
||||
'name' => 'Documents',
|
||||
'color' => null,
|
||||
'emoji' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $folder->created_at,
|
||||
'updated_at' => $folder->updated_at->toJson(),
|
||||
'items' => 0,
|
||||
'trashed_items' => 0,
|
||||
'type' => 'folder',
|
||||
'parent' => [
|
||||
'id' => $root->id,
|
||||
'name' => 'root',
|
||||
'items' => 2,
|
||||
'trashed_items' => 2,
|
||||
'type' => 'folder',
|
||||
],
|
||||
'shared' => null,
|
||||
],
|
||||
[
|
||||
'id' => $file->id,
|
||||
'user_id' => $user->id,
|
||||
'folder_id' => $root->id,
|
||||
'thumbnail' => null,
|
||||
'name' => 'Document',
|
||||
'basename' => 'document.pdf',
|
||||
'mimetype' => 'application/pdf',
|
||||
'filesize' => $file->filesize,
|
||||
'type' => 'file',
|
||||
'metadata' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $file->created_at,
|
||||
'updated_at' => $file->updated_at->toJson(),
|
||||
'file_url' => 'http://localhost/file/document.pdf',
|
||||
'parent' => [
|
||||
'id' => $root->id,
|
||||
'name' => 'root',
|
||||
'items' => 2,
|
||||
'trashed_items' => 2,
|
||||
'type' => 'folder',
|
||||
],
|
||||
'shared' => null,
|
||||
],
|
||||
->assertJsonFragment([
|
||||
'id' => $root->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $folder->id,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -248,55 +208,11 @@ class BrowseTest extends TestCase
|
||||
->actingAs($user)
|
||||
->getJson('/api/browse/latest')
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
[
|
||||
'id' => $file_2->id,
|
||||
'user_id' => $user->id,
|
||||
'folder_id' => $root->id,
|
||||
'thumbnail' => null,
|
||||
'name' => 'Document 2',
|
||||
'basename' => 'document-2.pdf',
|
||||
'mimetype' => 'application/pdf',
|
||||
'filesize' => $file_2->filesize,
|
||||
'type' => 'file',
|
||||
'metadata' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $file_2->created_at,
|
||||
'updated_at' => $file_2->updated_at->toJson(),
|
||||
'file_url' => 'http://localhost/file/document-2.pdf',
|
||||
'parent' => [
|
||||
'id' => $root->id,
|
||||
'name' => 'root',
|
||||
'items' => 2,
|
||||
'trashed_items' => 2,
|
||||
'type' => 'folder',
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => $file_1->id,
|
||||
'user_id' => $user->id,
|
||||
'folder_id' => $root->id,
|
||||
'thumbnail' => null,
|
||||
'name' => 'Document 1',
|
||||
'basename' => 'document-1.pdf',
|
||||
'mimetype' => 'application/pdf',
|
||||
'filesize' => $file_1->filesize,
|
||||
'type' => 'file',
|
||||
'metadata' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $file_1->created_at,
|
||||
'updated_at' => $file_1->updated_at->toJson(),
|
||||
'file_url' => 'http://localhost/file/document-1.pdf',
|
||||
'parent' => [
|
||||
'id' => $root->id,
|
||||
'name' => 'root',
|
||||
'items' => 2,
|
||||
'trashed_items' => 2,
|
||||
'type' => 'folder',
|
||||
],
|
||||
],
|
||||
->assertJsonFragment([
|
||||
'id' => $file_1->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $file_2->id,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -340,41 +256,11 @@ class BrowseTest extends TestCase
|
||||
->actingAs($user)
|
||||
->getJson('/api/browse/trash/undefined')
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
[
|
||||
'id' => $folder->id,
|
||||
'user_id' => $user->id,
|
||||
'parent_id' => null,
|
||||
'name' => 'root',
|
||||
'color' => null,
|
||||
'emoji' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => $folder->deleted_at,
|
||||
'created_at' => $folder->created_at,
|
||||
'updated_at' => $folder->updated_at->toJson(),
|
||||
'items' => 0,
|
||||
'trashed_items' => 1,
|
||||
'type' => 'folder',
|
||||
'parent' => null,
|
||||
],
|
||||
[
|
||||
'id' => $file->id,
|
||||
'user_id' => $user->id,
|
||||
'folder_id' => null,
|
||||
'thumbnail' => null,
|
||||
'name' => 'Document',
|
||||
'basename' => 'document.pdf',
|
||||
'mimetype' => 'application/pdf',
|
||||
'filesize' => $file->filesize,
|
||||
'type' => 'file',
|
||||
'metadata' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => $file->deleted_at,
|
||||
'created_at' => $file->created_at,
|
||||
'updated_at' => $file->updated_at->toJson(),
|
||||
'file_url' => 'http://localhost/file/document.pdf',
|
||||
'parent' => null,
|
||||
],
|
||||
->assertJsonFragment([
|
||||
'id' => $folder->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -398,24 +284,28 @@ class BrowseTest extends TestCase
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
collect([$folder, $file])
|
||||
->each(function ($item) use ($user) {
|
||||
Share::factory(Share::class)
|
||||
->create([
|
||||
'type' => $item->type === 'folder' ? 'folder' : 'file',
|
||||
'item_id' => $item->id,
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
});
|
||||
Share::factory(Share::class)
|
||||
->create([
|
||||
'type' => 'folder',
|
||||
'item_id' => $folder->id,
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
collect([$folder, $file])
|
||||
->each(function ($item) {
|
||||
$this->getJson('/api/browse/share')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'id' => $item->id,
|
||||
]);
|
||||
});
|
||||
Share::factory(Share::class)
|
||||
->create([
|
||||
'type' => 'file',
|
||||
'item_id' => $file->id,
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
$this->getJson('/api/browse/share')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'id' => $folder->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\Sharing;
|
||||
|
||||
use Tests\TestCase;
|
||||
@@ -26,13 +27,13 @@ class VisitorBrowseTest extends TestCase
|
||||
'id' => $share->id,
|
||||
'type' => 'shared',
|
||||
'attributes' => [
|
||||
'permission' => $share->permission,
|
||||
'protected' => false,
|
||||
'item_id' => $share->item_id,
|
||||
'expire_in' => $share->expire_in,
|
||||
'token' => $share->token,
|
||||
'link' => $share->link,
|
||||
'type' => $share->type,
|
||||
'permission' => $share->permission,
|
||||
'protected' => false,
|
||||
'item_id' => $share->item_id,
|
||||
'expire_in' => $share->expire_in,
|
||||
'token' => $share->token,
|
||||
'link' => $share->link,
|
||||
'type' => $share->type,
|
||||
],
|
||||
],
|
||||
]);
|
||||
@@ -168,41 +169,6 @@ class VisitorBrowseTest extends TestCase
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
$json = [
|
||||
[
|
||||
'id' => $folder->id,
|
||||
'user_id' => $user->id,
|
||||
'parent_id' => $root->id,
|
||||
'name' => 'Documents',
|
||||
'color' => null,
|
||||
'emoji' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $folder->created_at,
|
||||
'updated_at' => $folder->updated_at->toJson(),
|
||||
'items' => 0,
|
||||
'trashed_items' => 0,
|
||||
'type' => 'folder',
|
||||
],
|
||||
[
|
||||
'id' => $file->id,
|
||||
'user_id' => $user->id,
|
||||
'folder_id' => $root->id,
|
||||
'thumbnail' => null,
|
||||
'name' => 'Document',
|
||||
'basename' => 'document.pdf',
|
||||
'mimetype' => 'application/pdf',
|
||||
'filesize' => $file->filesize,
|
||||
'type' => 'file',
|
||||
'metadata' => null,
|
||||
'author' => 'user',
|
||||
'deleted_at' => null,
|
||||
'created_at' => $file->created_at,
|
||||
'updated_at' => $file->updated_at->toJson(),
|
||||
'file_url' => "http://localhost/file/document.pdf/$share->token",
|
||||
],
|
||||
];
|
||||
|
||||
// Check shared item protected by password
|
||||
if ($is_protected) {
|
||||
$cookie = ['share_session' => json_encode([
|
||||
@@ -214,14 +180,24 @@ class VisitorBrowseTest extends TestCase
|
||||
->withUnencryptedCookies($cookie)
|
||||
->get("/api/browse/folders/$root->id/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson($json);
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $folder->id,
|
||||
]);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
if (!$is_protected) {
|
||||
$this->getJson("/api/browse/folders/$root->id/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson($json);
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'id' => $folder->id,
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -328,7 +304,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);
|
||||
@@ -380,7 +356,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([
|
||||
@@ -431,7 +407,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([]);
|
||||
@@ -478,7 +454,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