mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 03:10:51 +00:00
share routes refactoring
This commit is contained in:
@@ -138,7 +138,7 @@ class VisitorAccessToItemsTest extends TestCase
|
||||
]);
|
||||
|
||||
// Get share record
|
||||
$this->get("/api/browse/file/$share->token")
|
||||
$this->get("/api/sharing/file/$share->token")
|
||||
->assertStatus(403);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class VisitorBrowseTest extends TestCase
|
||||
'password' => bcrypt('secret'),
|
||||
]);
|
||||
|
||||
$this->postJson("/api/browse/authenticate/$share->token", [
|
||||
$this->postJson("/api/sharing/authenticate/$share->token", [
|
||||
'password' => 'secret',
|
||||
])
|
||||
->assertStatus(200)
|
||||
@@ -120,7 +120,7 @@ class VisitorBrowseTest extends TestCase
|
||||
'password' => bcrypt('secret'),
|
||||
]);
|
||||
|
||||
$this->postJson("/api/browse/authenticate/$share->token", [
|
||||
$this->postJson("/api/sharing/authenticate/$share->token", [
|
||||
'password' => 'bad-password',
|
||||
])
|
||||
->assertStatus(401)
|
||||
@@ -298,14 +298,14 @@ class VisitorBrowseTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->get("/api/browse/navigation/$share->token")
|
||||
->get("/api/sharing/navigation/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson($tree);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/navigation/$share->token")
|
||||
$this->getJson("/api/sharing/navigation/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson($tree);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ class VisitorBrowseTest extends TestCase
|
||||
])];
|
||||
|
||||
$this->withUnencryptedCookies($cookie)
|
||||
->get("/api/search/$share->token?query=doc")
|
||||
->get("/api/sharing/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
@@ -357,7 +357,7 @@ class VisitorBrowseTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/search/$share->token?query=doc")
|
||||
$this->getJson("/api/sharing/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'id' => $file->id,
|
||||
@@ -401,14 +401,14 @@ class VisitorBrowseTest extends TestCase
|
||||
])];
|
||||
|
||||
$this->withUnencryptedCookies($cookie)
|
||||
->get("/api/search/$share->token?query=doc")
|
||||
->get("/api/sharing/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([]);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/search/$share->token?query=doc")
|
||||
$this->getJson("/api/sharing/search/$share->token?query=doc")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([]);
|
||||
}
|
||||
@@ -446,7 +446,7 @@ class VisitorBrowseTest extends TestCase
|
||||
])];
|
||||
|
||||
$this->withUnencryptedCookies($cookie)
|
||||
->get("/api/browse/file/$share->token")
|
||||
->get("/api/sharing/file/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'name' => 'Document',
|
||||
@@ -455,7 +455,7 @@ class VisitorBrowseTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->getJson("/api/browse/file/$share->token")
|
||||
$this->getJson("/api/sharing/file/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'name' => 'Document',
|
||||
|
||||
@@ -52,7 +52,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->patch("/api/editor/rename/{$file->id}/$share->token", [
|
||||
->patch("/api/sharing/rename/{$file->id}/$share->token", [
|
||||
'name' => 'Renamed Item',
|
||||
'type' => 'file',
|
||||
])
|
||||
@@ -64,7 +64,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->patchJson("/api/editor/rename/{$file->id}/$share->token", [
|
||||
$this->patchJson("/api/sharing/rename/{$file->id}/$share->token", [
|
||||
'name' => 'Renamed Item',
|
||||
'type' => 'file',
|
||||
])
|
||||
@@ -122,7 +122,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->patch("/api/editor/rename/{$children->id}/$share->token", [
|
||||
->patch("/api/sharing/rename/{$children->id}/$share->token", [
|
||||
'name' => 'Renamed Folder',
|
||||
'type' => 'folder',
|
||||
])
|
||||
@@ -134,7 +134,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->patchJson("/api/editor/rename/{$children->id}/$share->token", [
|
||||
$this->patchJson("/api/sharing/rename/{$children->id}/$share->token", [
|
||||
'name' => 'Renamed Folder',
|
||||
'type' => 'folder',
|
||||
])
|
||||
@@ -186,7 +186,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->post("/api/editor/create-folder/$share->token", [
|
||||
->post("/api/sharing/create-folder/$share->token", [
|
||||
'name' => 'Awesome New Folder',
|
||||
'parent_id' => $folder->id,
|
||||
])
|
||||
@@ -198,7 +198,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->postJson("/api/editor/create-folder/$share->token", [
|
||||
$this->postJson("/api/sharing/create-folder/$share->token", [
|
||||
'name' => 'Awesome New Folder',
|
||||
'parent_id' => $folder->id,
|
||||
])
|
||||
@@ -272,13 +272,13 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->post("/api/editor/remove/$share->token", $payload)
|
||||
->post("/api/sharing/remove/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->postJson("/api/editor/remove/$share->token", $payload)
|
||||
$this->postJson("/api/sharing/remove/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->post("/api/editor/upload/chunks/$share->token", [
|
||||
->post("/api/sharing/upload/chunks/$share->token", [
|
||||
'name' => $file->name,
|
||||
'extension' => 'pdf',
|
||||
'chunk' => $file,
|
||||
@@ -340,7 +340,7 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->postJson("/api/editor/upload/chunks/$share->token", [
|
||||
$this->postJson("/api/sharing/upload/chunks/$share->token", [
|
||||
'name' => $file->name,
|
||||
'extension' => 'pdf',
|
||||
'chunk' => $file,
|
||||
@@ -414,14 +414,14 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->post("/api/editor/move/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
->post("/api/sharing/move/$share->token", $payload)
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->postJson("/api/editor/move/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
$this->postJson("/api/sharing/move/$share->token", $payload)
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
$this->assertDatabaseHas('files', [
|
||||
@@ -487,14 +487,14 @@ class VisitorManipulatingTest extends TestCase
|
||||
|
||||
$this
|
||||
->withUnencryptedCookies($cookie)
|
||||
->post("/api/editor/move/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
->post("/api/sharing/move/$share->token", $payload)
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
// Check public shared item
|
||||
if (! $is_protected) {
|
||||
$this->postJson("/api/editor/move/$share->token", $payload)
|
||||
->assertStatus(204);
|
||||
$this->postJson("/api/sharing/move/$share->token", $payload)
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
$this->assertDatabaseHas('folders', [
|
||||
|
||||
Reference in New Issue
Block a user