mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
deleted old files
This commit is contained in:
@@ -186,57 +186,4 @@ class VisitorAccessToItemsTest extends TestCase
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_download_publicly_zipped_files()
|
||||
{
|
||||
collect([true, false])
|
||||
->each(function ($is_protected) {
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
$share = Share::factory(Share::class)
|
||||
->create([
|
||||
'user_id' => $user->id,
|
||||
'type' => 'folder',
|
||||
'is_protected' => $is_protected,
|
||||
]);
|
||||
|
||||
$zip = Zip::factory(Zip::class)->create([
|
||||
'basename' => 'EHWKcuvKzA4Gv29v-archive.zip',
|
||||
'user_id' => $user->id,
|
||||
'shared_token' => $share->token,
|
||||
]);
|
||||
|
||||
$file = UploadedFile::fake()
|
||||
->create($zip->basename, 1000, 'application/zip');
|
||||
|
||||
Storage::putFileAs('zip', $file, $file->name);
|
||||
|
||||
if ($is_protected) {
|
||||
$cookie = [
|
||||
'share_session' => json_encode([
|
||||
'token' => $share->token,
|
||||
'authenticated' => true,
|
||||
]),
|
||||
];
|
||||
|
||||
$this->withCookies($cookie)
|
||||
->get("/zip/$zip->id/$share->token")
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
if (! $is_protected) {
|
||||
$this->get("/zip/$zip->id/$share->token")
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
$this->assertDatabaseMissing('traffic', [
|
||||
'user_id' => $user->id,
|
||||
'download' => null,
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user