mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
41 lines
923 B
PHP
41 lines
923 B
PHP
<?php
|
|
namespace Tests\Support\Demo;
|
|
|
|
use Tests\TestCase;
|
|
use App\Users\Models\User;
|
|
use Domain\Sharing\Models\Share;
|
|
use Support\Demo\Actions\DeleteAllDemoSharedLinksAction;
|
|
|
|
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(DeleteAllDemoSharedLinksAction::class)();
|
|
|
|
$this->assertDatabaseHas('shares', [
|
|
'user_id' => $user->id,
|
|
])->assertDatabaseMissing('shares', [
|
|
'user_id' => $howdy->id,
|
|
]);
|
|
}
|
|
}
|