public function setUp()
 {
     parent::setUp();
     $this->generator = new ZenginGenerator();
     $this->account = new BankAccount();
     $this->account->setType(BankAccount::TYPE_NORMAL);
     $this->account->setBankName('ミツイスミトモ');
     $this->account->setBankCode('0009');
     $this->account->setBranchName('アカサカ');
     $this->account->setBranchCode('825');
     $this->account->setHolderName('スラビ');
     $this->account->setNumber('9876543');
     $this->account->setCompanyCode('1234560789');
 }
 public function testValidationFailsOnNon10DigitCompanyCodes()
 {
     $this->account->setCompanyCode('01234567890');
     $this->assertSame('01234567890', $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 1);
     $this->assertTrue(count($violations->get('companyCode')) === 1);
     $this->account->setCompanyCode('012345678');
     $this->assertSame('012345678', $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 1);
     $this->assertTrue(count($violations->get('companyCode')) === 1);
     $this->account->setCompanyCode('0123456789');
     $this->assertSame('0123456789', $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 1);
     $this->assertTrue(count($violations->get('companyCode')) === 1);
     $this->account->setCompanyCode('0123456789');
     $this->assertSame('0123456789', $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 0);
     //Not required.
     $this->account->setCompanyCode('');
     $this->assertSame('', $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 0);
     //Not required.
     $this->account->setCompanyCode(null);
     $this->assertSame(null, $this->account->getCompanyCode());
     $violations = Validator::validateBankAccount($this->account, null);
     $this->assertTrue(count($violations) === 0);
 }
 public function setUp()
 {
     parent::setUp();
     $bankAccount = new BankAccount();
     $bankAccount->setType(BankAccount::TYPE_NORMAL);
     $bankAccount->setBankName('ミツイスミトモ');
     $bankAccount->setBankCode('0009');
     $bankAccount->setBranchName('アカサカ');
     $bankAccount->setBranchCode('825');
     $bankAccount->setHolderName('スラビ');
     $bankAccount->setNumber('9876543');
     $bankAccount->setCompanyCode('1234560789');
     $this->transaction = new MoneyTransferTransaction();
     $this->transaction->setDestinationBankAccount($bankAccount);
     $this->transaction->setAmount(15234);
 }
 public function setUp()
 {
     parent::setUp();
     $senderBankAccount = new BankAccount();
     $senderBankAccount->setType(BankAccount::TYPE_NORMAL);
     $senderBankAccount->setBankName('ミツイスミトモ');
     $senderBankAccount->setBankCode('0009');
     $senderBankAccount->setBranchName('アカサカ');
     $senderBankAccount->setBranchCode('825');
     $senderBankAccount->setHolderName('スラビ');
     $senderBankAccount->setNumber('9876543');
     $senderBankAccount->setCompanyCode('1234560789');
     $this->transferRequest = new TransferRequest();
     $this->transferRequest->setType(TransferRequest::TYPE_GENERAL);
     $this->transferRequest->setSourceBankAccount($senderBankAccount);
     $this->transferRequest->setDate(\DateTime::createFromFormat('Y-m-d', '2016-02-25'));
     $receiverBankAccount = new BankAccount();
     $receiverBankAccount->setType(BankAccount::TYPE_NORMAL);
     $receiverBankAccount->setBankName('トウキョウトミン');
     $receiverBankAccount->setHolderName('テストー.カブシキガイシャ');
     //Note: using a normal dot/dash in this example
     $receiverBankAccount->setBankCode('0137');
     $receiverBankAccount->setBranchName('シブヤ');
     $receiverBankAccount->setBranchCode('031');
     $receiverBankAccount->setNumber('1231990');
     $receiverTransaction = new MoneyTransferTransaction();
     $receiverTransaction->setDestinationBankAccount($receiverBankAccount);
     $receiverTransaction->setAmount(1103661);
     $this->transferRequest->addTransaction($receiverTransaction);
     $receiverBankAccount = new BankAccount();
     $receiverBankAccount->setType(BankAccount::TYPE_NORMAL);
     $receiverBankAccount->setBankName('ベツバンク');
     $receiverBankAccount->setHolderName('ヒトノナマエ');
     //Note: using a normal dot/dash in this example
     $receiverBankAccount->setBankCode('0132');
     $receiverBankAccount->setBranchName('イケブクロ');
     $receiverBankAccount->setBranchCode('021');
     $receiverBankAccount->setNumber('1331990');
     $receiverTransaction = new MoneyTransferTransaction();
     $receiverTransaction->setDestinationBankAccount($receiverBankAccount);
     $receiverTransaction->setAmount(657856);
     $this->transferRequest->addTransaction($receiverTransaction);
 }