Example #1
0
 public function test_that_command_is_executed_by_pipeline()
 {
     $handler = new RegisterUserHandler();
     $this->commandMap->registerHandlers([RegisterUserCommand::class => $handler]);
     $command = new RegisterUserCommand();
     $command->setFirstName('James')->setMiddleName('D')->setLastName('Smith')->setEmail('*****@*****.**')->setPassword('secret');
     $this->pipeline->execute($command);
     $this->assertTrue($this->commandMap->hasHandler(RegisterUserCommand::class) && $this->logHandler->hasInfoThatContains(sprintf('Command received {%s}', ClassName::canonical(RegisterUserCommand::class))) && $this->logHandler->hasInfoThatContains(sprintf('Command handled {%s}', ClassName::canonical(RegisterUserCommand::class))) && $handler->isHandled());
 }