protected function applyNoteAdded(NoteAdded $domainEvent) { $noteId = $domainEvent->noteId(); $text = $domainEvent->noteText(); $note = Note::write($noteId, $text); $this->notes[] = $note; }
/** * @expectedException Novuso\Common\Domain\EventSourcing\Exception\RegisterAggregateException */ public function test_that_get_aggregate_root_throws_exception_without_aggregate_root() { $note = Note::write(NoteId::generate(), 'test'); $note->aggregateRoot(); }