コード例 #1
0
ファイル: EconomyContext.php プロジェクト: JavierCane/mpwar
 private function ensureExpectedAccount()
 {
     return function (array $accountInfo) {
         $expected = $this->virtualMoney($accountInfo);
         $actual = $this->find(AccountOwnerStub::create($accountInfo['owner']));
         Assertions::assertEquals($expected, $actual->balance());
     };
 }
コード例 #2
0
 /** @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);
 }
コード例 #3
0
ファイル: AccountStub.php プロジェクト: JavierCane/mpwar
 public static function random()
 {
     return self::create(AccountOwnerStub::random(), VirtualMoneyStub::randomCoins());
 }