/**
  * @test
  */
 public function itShouldThrowAnExceptionIfTheLoadedEntityIsNotAnApplicationUser()
 {
     $userId = \Mockery::mock(ApplicationUserId::class);
     $user = \Mockery::mock(AggregateRoot::class);
     $repository = new UserEventSourcedRepository($this->repository);
     $this->repository->shouldReceive('load')->with($userId)->andReturn($user);
     $this->setExpectedException(\InvalidArgumentException::class);
     $repository->load($userId);
 }
 private function givenGameDoesNotExist()
 {
     $this->eventSourcingRepository->shouldReceive('load')->with($this->gameId)->andReturn(null);
 }