Пример #1
0
 protected function applyNoteAdded(NoteAdded $domainEvent)
 {
     $noteId = $domainEvent->noteId();
     $text = $domainEvent->noteText();
     $note = Note::write($noteId, $text);
     $this->notes[] = $note;
 }
Пример #2
0
 /**
  * @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();
 }