public function testValidationFailsOnNon7DigitAccountNumbers() { $this->account->setNumber('12345678'); $this->assertSame('12345678', $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('number')) === 1); $this->account->setNumber('123456'); $this->assertSame('123456', $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('number')) === 1); $this->account->setNumber('1234567'); $this->assertSame('1234567', $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('number')) === 1); $this->account->setNumber('1234567'); $this->assertSame('1234567', $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 0); $this->account->setNumber(''); $this->assertSame('', $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('number')) === 1); $this->account->setNumber(null); $this->assertSame(null, $this->account->getNumber()); $violations = Validator::validateBankAccount($this->account, null); $this->assertTrue(count($violations) === 1); $this->assertTrue(count($violations->get('number')) === 1); }