Testing Event Sourcing Applications
Testing Event Sourcing applications in PHP
Testing Aggregates
/** Setting up event sourced aggregate initial events */
$this->assertEquals(
'Andrew',
EcotoneLite::bootstrapFlowTesting([Ticket::class])
// 1. setting up initial events for aggregate
->withEventsFor($ticketId, Ticket::class, [
new TicketWasRegistered($ticketId, 'Johny', 'alert'),
new AssignedPersonWasChanged($ticketId, 'Elvis'),
])
->sendCommand(new ChangeAssignedPerson($ticketId, 'Andrew'))
->getAggregate(Ticket::class, $ticketId)
->getAssignedPerson()
);Testing Aggregates with Event Store
Testing Projections
Acceptance Tests
Testing with Real Event Store
Last updated
Was this helpful?