webDEVILopers
webDEVILopers
Exactly. ```php final class RegistrationManager implements MessageSubscriberInterface { private MessageBusInterface $commandBus; public function __construct(MessageBusInterface $commandBus) { $this->commandBus = $commandBus; } public function onHostRegistered(HostRegistered $event): void { $command = new SendVerificationEmail(...
Thanks for your feedback @prolic and @JulianMay . I must confess that I was just curious how the solution would technically look like. Indeed this is a very easy use...
Our current basic test: ```php final class LoginControllerTest extends AbstractControllerTest { /** @test */ public function itCanBeAccessedAnonymously(): void { $commandHandlerMock = $this->getMockBuilder(LoginHostHandler::class) ->disableOriginalConstructor() ->getMock(); $this->client->getContainer()->set(LoginHostHandler::class, $commandHandlerMock); $content = [ 'emailAddress'...
> Seems that your example is not correct, `HostReadModel` is never beeing used? Thank you! The `$hostDetails` is the read model. I added a `@var` doc to it.
> IMO you can use your real `LoginHostHandler` and mock away every dependency of ``LoginHostHandler` which have side effects? I must confess I did not understand this line. Could you...
Sorry for the late reply @HellPat ! > So the question is: why don't you just test the handler it self (as stated in the issue title)? I must confess...
> First of all, would you move the logic away from the handler e.g. to a "LoginService"? > no would't. > After all your Handler is already a single function...
BTW @HellPat Are you on Twitter?
```php final class UniqueValueAddedTaxIdentifierNumberPolicy { private HostReadModelRepository $repository; public function __construct(HostReadModelRepository $repository) { $this->repository = $repository; } public function isSatisfiedBy(HostId $hostId, ValueAddedTaxIdentificationNumber $vatId): bool { try { $host = $this->repository->ofVatId($vatId);...
I have a legacy app that handles `Contract`s. A Contract has general `Details` but also `Invoicing Details`. First of all these would totally belong into a different bounded context. But...