mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
- added not found exception for Model
- cleared dev console - get share record refactored on backend
This commit is contained in:
@@ -37,6 +37,11 @@ class AppTest extends TestCase
|
||||
'value' => 'setup-done',
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'license',
|
||||
'value' => 'Extended',
|
||||
]);
|
||||
|
||||
$this->get('/')
|
||||
->assertStatus(200)
|
||||
->assertSee('setup-done')
|
||||
|
||||
@@ -212,7 +212,7 @@ class ContentAccessTest extends TestCase
|
||||
Sanctum::actingAs($users[1]);
|
||||
|
||||
$this->get("file/$file->name")
|
||||
->assertNotFound();
|
||||
->assertStatus(404);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,6 +89,45 @@ class ShareContentAccessTest extends TestCase
|
||||
->assertStatus(403);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_shared_image()
|
||||
{
|
||||
Storage::fake('local');
|
||||
|
||||
$this->setup->create_directories();
|
||||
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
$thumbnail = UploadedFile::fake()
|
||||
->image(Str::random() . '-fake-image.jpg');
|
||||
|
||||
Storage::putFileAs("files/$user->id", $thumbnail, $thumbnail->name);
|
||||
|
||||
$file = File::factory(File::class)
|
||||
->create([
|
||||
'user_id' => $user->id,
|
||||
'thumbnail' => $thumbnail->name,
|
||||
'basename' => $thumbnail->name,
|
||||
'name' => 'fake-thumbnail.jpg',
|
||||
'type' => 'image',
|
||||
'mimetype' => 'jpg',
|
||||
]);
|
||||
|
||||
$share = Share::factory(Share::class)
|
||||
->create([
|
||||
'item_id' => $file->id,
|
||||
'user_id' => $user->id,
|
||||
'type' => 'file',
|
||||
'is_protected' => false,
|
||||
]);
|
||||
|
||||
$this->get("/shared/$share->token")
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
||||
@@ -255,7 +255,7 @@ class ShareTest extends TestCase
|
||||
'type' => 'shares',
|
||||
'attributes' => [
|
||||
'permission' => $share->permission,
|
||||
'is_protected' => '0',
|
||||
'is_protected' => false,
|
||||
'item_id' => $share->item_id,
|
||||
'expire_in' => $share->expire_in,
|
||||
'token' => $share->token,
|
||||
@@ -284,7 +284,7 @@ class ShareTest extends TestCase
|
||||
{
|
||||
$share = Share::factory(Share::class)
|
||||
->create([
|
||||
'type' => 'file',
|
||||
'type' => 'folder',
|
||||
'is_protected' => false,
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user