/** @test */ public function it_should_open_an_account_when_a_player_has_been_registered() { $event = PlayerRegisteredStub::random(); $owner = AccountOwnerStub::create($event->aggregateId()); $account = AccountStub::create($owner, VirtualMoneyStub::zeroCoins()); $accountOpened = AccountOpenedStub::create($owner, new DateTimeImmutable()); $this->shouldSearchAccount($owner); $this->shouldPersistAccount($account); $this->shouldHandleEvent($accountOpened); $this->subscriber->notify($event); }