public function testValidationFailsOnNonKatakanaBankName() { //Hiragana $this->account->setBankName('てすと'); $this->assertSame('てすと', $this->account->getBankName()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('bankName')) === 1); //Half-width Katakana $this->account->setBankName('ミツイスミトモ'); $this->assertSame('ミツイスミトモ', $this->account->getBankName()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('bankName')) === 1); //Kanji $this->account->setBankName('銀行'); $this->assertSame('銀行', $this->account->getBankName()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('bankName')) === 1); //Cyrillic $this->account->setBankName('Банка'); $this->assertSame('Банка', $this->account->getBankName()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('bankName')) === 1); }
public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account) { $this->name = $name; $this->taxIdNumber = (string) $taxIdNumber; $this->postalCode = $address->getPostalCode(); $this->street = $address->getStreet(); $this->city = $address->getCity(); $this->country = $address->getCountry(); $this->bankName = $account->getBankName(); $this->bankNumber = $account->getBankNumber(); $this->bicCode = $account->getBicCode(); }
public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account) { if (!$name) { throw new \InvalidArgumentException('Name is required'); } $this->name = $name; $this->taxIdNumber = (string) $taxIdNumber; $this->postalCode = $address->getPostalCode(); $this->street = $address->getStreet(); $this->city = $address->getCity(); $this->country = $address->getCountry(); $this->bankName = $account->getBankName(); $this->bankNumber = $account->getBankNumber(); $this->bicCode = $account->getBicCode(); }