Compare commits
No commits in common. "820a7255176a2ffdfed011877cebce3644688d35" and "cfb38ed792b37a8193f1ce5773b67c5ebb001a9b" have entirely different histories.
820a725517
...
cfb38ed792
|
@ -35,12 +35,5 @@
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"pestphp/pest-plugin": true
|
"pestphp/pest-plugin": true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"extra": {
|
|
||||||
"laravel": {
|
|
||||||
"providers": [
|
|
||||||
"Zoomyboy\\MedialibraryHelper\\ServiceProvider"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zoomyboy\MedialibraryHelper\Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Zoomyboy\MedialibraryHelper\Tests\TestCase;
|
||||||
|
|
||||||
|
class MiddlewareTest extends TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
public function testItReturns401WhenNotLoggedIn(): void
|
||||||
|
{
|
||||||
|
$this->registerModel();
|
||||||
|
$post = $this->newPost();
|
||||||
|
|
||||||
|
$response = $this->postJson('/mediaupload', [
|
||||||
|
'model' => 'post',
|
||||||
|
'id' => $post->id,
|
||||||
|
'collection' => 'defaultSingleFile',
|
||||||
|
'content' => base64_encode($this->pdfFile()->getContent()),
|
||||||
|
'name' => 'beispiel bild.jpg',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$response->assertStatus(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testItReturns401WhenDestroying(): void
|
||||||
|
{
|
||||||
|
$this->registerModel();
|
||||||
|
$post = $this->newPost();
|
||||||
|
$media = $post->addMedia($this->pdfFile()->getPathname())->toMediaCollection('defaultSingleFile');
|
||||||
|
|
||||||
|
$response = $this->deleteJson("/mediaupload/{$media->id}");
|
||||||
|
|
||||||
|
$response->assertStatus(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineEnvironment($app)
|
||||||
|
{
|
||||||
|
$app['config']->set('media-library.middleware', ['web', 'auth:web']);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue