2021-11-30 17:39:33 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Unit\Events;
|
|
|
|
|
|
|
|
use App\Events\TwoFAccountDeleted;
|
2022-11-22 15:15:52 +01:00
|
|
|
use App\Models\TwoFAccount;
|
2022-07-29 18:34:27 +02:00
|
|
|
use App\Services\SettingService;
|
2022-11-22 15:15:52 +01:00
|
|
|
use Mockery\MockInterface;
|
2023-08-01 11:28:27 +02:00
|
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
2024-06-26 14:29:13 +02:00
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
2022-11-22 15:15:52 +01:00
|
|
|
use Tests\TestCase;
|
2021-11-30 17:39:33 +01:00
|
|
|
|
|
|
|
/**
|
2023-08-01 11:28:27 +02:00
|
|
|
* TwoFAccountDeletedTest test class
|
2021-11-30 17:39:33 +01:00
|
|
|
*/
|
2023-08-01 11:28:27 +02:00
|
|
|
#[CoversClass(TwoFAccountDeleted::class)]
|
2021-11-30 17:39:33 +01:00
|
|
|
class TwoFAccountDeletedTest extends TestCase
|
|
|
|
{
|
2024-06-26 14:29:13 +02:00
|
|
|
#[Test]
|
2021-11-30 17:39:33 +01:00
|
|
|
public function test_event_constructor()
|
|
|
|
{
|
2022-07-29 18:34:27 +02:00
|
|
|
$settingService = $this->mock(SettingService::class, function (MockInterface $settingService) {
|
|
|
|
$settingService->shouldReceive('get')
|
|
|
|
->andReturn(false);
|
|
|
|
});
|
|
|
|
|
2021-12-02 13:15:53 +01:00
|
|
|
$twofaccount = TwoFAccount::factory()->make();
|
2022-11-22 15:15:52 +01:00
|
|
|
$event = new TwoFAccountDeleted($twofaccount);
|
2021-11-30 17:39:33 +01:00
|
|
|
|
|
|
|
$this->assertSame($twofaccount, $event->twofaccount);
|
|
|
|
}
|
2022-11-22 15:15:52 +01:00
|
|
|
}
|