ldc-arcadia-api/tests/Integration/Infra/Adapters/Events/LaravelDomainEventDispatcherTest.php
Jérémy Munsch 43758922ad
feat(console): add ToggleClientStatus command and related logic
- Implemented command to toggle client status via console.
- Introduced SetClientStatus use case for managing client activation.
- Added presenters and views for command output.
- Created tests for command functionality and edge cases.
2026-08-18 16:56:15 +02:00

34 lines
884 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Integration\Infra\Adapters\Events;
use Illuminate\Contracts\Events\Dispatcher;
use Infra\Adapters\Events\LaravelDomainEventDispatcher;
use Mockery;
use Shared\DDD\Event\Event;
covers(LaravelDomainEventDispatcher::class);
describe('LaravelDomainEventDispatcher Integration Tests', function (): void {
it('dispatches domain events to Laravel event dispatcher', function (): void {
// GIVEN
$laravelDispatcher = Mockery::mock(Dispatcher::class);
$dispatcher = new LaravelDomainEventDispatcher($laravelDispatcher);
$event = new class () implements Event
{
};
$laravelDispatcher->expects('dispatch')
->once()
->with($event);
// WHEN
$dispatcher->dispatch($event);
// THEN
expect(true)->toBeTrue();
});
});