deleted old files

This commit is contained in:
Peter Papp
2021-07-28 18:33:13 +02:00
parent 71a1eb8e7c
commit 6a805b03fa
14 changed files with 9 additions and 361 deletions

View File

@@ -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,
]);
});
}
}