mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
delete only howdy share links in demo mode
This commit is contained in:
41
tests/Support/Demo/DemoTest.php
Normal file
41
tests/Support/Demo/DemoTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Support\Demo;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Domain\Sharing\Models\Share;
|
||||
use Support\Demo\Actions\DeleteAllSharedLinksAction;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DemoTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_delete_howdy_shared_links()
|
||||
{
|
||||
$user = User::factory()
|
||||
->hasSettings()
|
||||
->create();
|
||||
|
||||
$howdy = User::factory()
|
||||
->hasSettings()
|
||||
->create([
|
||||
'email' => 'howdy@hi5ve.digital',
|
||||
]);
|
||||
|
||||
Share::factory()
|
||||
->create(['user_id' => $user->id]);
|
||||
|
||||
Share::factory()
|
||||
->create(['user_id' => $howdy->id]);
|
||||
|
||||
resolve(DeleteAllSharedLinksAction::class)();
|
||||
|
||||
$this->assertDatabaseHas('shares', [
|
||||
'user_id' => $user->id,
|
||||
])->assertDatabaseMissing('shares', [
|
||||
'user_id' => $howdy->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user