sharing route refactoring

This commit is contained in:
Čarodej
2022-05-16 12:33:09 +02:00
parent 68dc04963d
commit f66982b3ec
6 changed files with 87 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ class VisitorBrowseTest extends TestCase
'is_protected' => 0,
]);
$this->get("/api/browse/share/$share->token")
$this->get("/api/sharing/$share->token")
->assertStatus(200)
->assertExactJson([
'data' => [
@@ -63,7 +63,7 @@ class VisitorBrowseTest extends TestCase
*/
public function it_try_to_get_deleted_share_record()
{
$this->get('/api/browse/share/19ZMPNiass4ZqWwQ')
$this->get('/api/sharing/19ZMPNiass4ZqWwQ')
->assertNotFound();
}
@@ -180,7 +180,7 @@ class VisitorBrowseTest extends TestCase
$this
->withUnencryptedCookies($cookie)
->get("/api/browse/folders/$root->id/$share->token")
->get("/api/sharing/folders/$root->id/$share->token")
->assertStatus(200)
->assertJsonFragment([
'id' => $file->id,
@@ -192,7 +192,7 @@ class VisitorBrowseTest extends TestCase
// Check public shared item
if (! $is_protected) {
$this->getJson("/api/browse/folders/$root->id/$share->token")
$this->getJson("/api/sharing/folders/$root->id/$share->token")
->assertStatus(200)
->assertJsonFragment([
'id' => $file->id,

View File

@@ -89,7 +89,7 @@ class SharedZippingTest extends TestCase
$this
->withUnencryptedCookies($cookie)
->get("/api/zip/{$share->token}?items=$files[0]|file,$files[1]|file,$folder->id|folder")
->get("/api/sharing/zip/{$share->token}?items=$files[0]|file,$files[1]|file,$folder->id|folder")
->assertStatus(200)
->assertHeader('content-type', 'application/x-zip');
}
@@ -97,7 +97,7 @@ class SharedZippingTest extends TestCase
// Check public shared item
if (! $is_protected) {
$this
->get("/api/zip/{$share->token}?items=$files[0]|file,$files[1]|file,$folder->id|folder")
->get("/api/sharing/zip/{$share->token}?items=$files[0]|file,$files[1]|file,$folder->id|folder")
->assertStatus(200)
->assertHeader('content-type', 'application/x-zip');
}
@@ -152,14 +152,14 @@ class SharedZippingTest extends TestCase
$this
->withUnencryptedCookies($cookie)
->get("/api/zip/$share->token?items=$files[0]|file,$files[1]|file")
->get("/api/sharing/zip/$share->token?items=$files[0]|file,$files[1]|file")
->assertStatus(403);
}
// Check public shared item
if (! $is_protected) {
$this
->get("/api/zip/$share->token?items=$files[0]|file,$files[1]|file")
->get("/api/sharing/zip/$share->token?items=$files[0]|file,$files[1]|file")
->assertStatus(403);
}
@@ -267,13 +267,13 @@ class SharedZippingTest extends TestCase
$this
->withUnencryptedCookies($cookie)
->get("/api/zip/$share->token?items=$folder->id|folder")
->get("/api/sharing/zip/$share->token?items=$folder->id|folder")
->assertStatus(403);
}
// Check public shared item
if (! $is_protected) {
$this->getJson("/api/zip/$share->token?items=$folder->id|folder")
$this->getJson("/api/sharing/zip/$share->token?items=$folder->id|folder")
->assertStatus(403);
}
});