- 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.
34 lines
884 B
PHP
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();
|
|
});
|
|
});
|