Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jun 27, 2024
1 parent ff26f67 commit 056ea85
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/Http/DownloadControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

Check warning on line 1 in tests/Http/DownloadControllerTest.php

View workflow job for this annotation

GitHub Actions / 4️⃣ Coding Standards

Found violation(s) of type: no_unused_imports

namespace Cone\Root\Tests\Http;

use Cone\Root\Models\Medium;
use Cone\Root\Root;
use Cone\Root\Tests\TestCase;
use Cone\Root\Tests\User;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;

class DownloadControllerTest extends TestCase
{
protected User $admin;

public function setUp(): void
{
parent::setUp();

$this->admin = User::factory()->create();
}

public function test_a_download_controller_handles_request(): void
{
$medium = Medium::factory()->create();

Storage::disk('public')->put($medium->getPath(), 'test content');

$this->actingAs($this->admin)
->get(URL::signedRoute('root.download', $medium))
->assertOk()
->assertDownload($medium->file_name);
}
}

0 comments on commit 056ea85

Please sign in to comment.