2FAuth/tests/Unit/Events/TwoFAccountDeletedTest.php

33 lines
854 B
PHP

<?php
namespace Tests\Unit\Events;
use App\Events\TwoFAccountDeleted;
use App\Models\TwoFAccount;
use App\Services\SettingService;
use Mockery\MockInterface;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
/**
* TwoFAccountDeletedTest test class
*/
#[CoversClass(TwoFAccountDeleted::class)]
class TwoFAccountDeletedTest extends TestCase
{
#[Test]
public function test_event_constructor()
{
$settingService = $this->mock(SettingService::class, function (MockInterface $settingService) {
$settingService->shouldReceive('get')
->andReturn(false);
});
$twofaccount = TwoFAccount::factory()->make();
$event = new TwoFAccountDeleted($twofaccount);
$this->assertSame($twofaccount, $event->twofaccount);
}
}