public function it_can_not_register_already_committed_aggregate_roots(AggregateRoot $aggregateRoot) { $aggregateRoot->lastCommittedEventSequenceNumber()->willReturn(1); $this->shouldThrow(new \InvalidArgumentException('Only new aggregates can be added to the repository.'))->during('add', [$aggregateRoot]); }