private function ensureExpectedAccount() { return function (array $accountInfo) { $expected = $this->virtualMoney($accountInfo); $actual = $this->find(AccountOwnerStub::create($accountInfo['owner'])); Assertions::assertEquals($expected, $actual->balance()); }; }
/** @test */ public function it_should_not_allow_open_an_account_to_an_owner_that_already_has_one() { $this->setExpectedException(AccountOwnerAlreadyHasAnAccountException::class); $event = PlayerRegisteredStub::random(); $owner = AccountOwnerStub::create($event->aggregateId()); $this->shouldSearchAccount($owner, AccountStub::owned($owner)); $this->subscriber->notify($event); }
public static function random() { return self::create(AccountOwnerStub::random(), VirtualMoneyStub::randomCoins()); }