Exemplo n.º 1
0
 /**
  * @dataProvider provideBanks
  */
 public function testCrossProjects(Bank $bank)
 {
     try {
         // Skip failed bank dependend validators or valid independend validators.
         $isSkip = $bank->getValidator() instanceof Validator_BankDependent ? array_key_exists($bank->getValidationType(), $this->failedBankDependentValidators) : array_key_exists($bank->getValidationType(), $this->testedValidators);
         if ($isSkip) {
             return;
         }
         // Generate accounts from $this->lastAccount until 0.
         for ($account = $this->lastAccount; $account >= 0; $account--) {
             // Generate accounts with padded zeros up to $this->accountPadSize
             for ($pad = strlen($account); $pad <= $this->accountPadSize; $pad++) {
                 $paddedAccount = str_pad($account, $pad, "0", STR_PAD_LEFT);
                 $this->assertSameResult($bank, $paddedAccount);
             }
         }
     } catch (BankNotFoundTestAPIException $e) {
         return;
     } catch (Exception $e) {
         if ($bank instanceof Validator_BankDependent) {
             $this->failedBankDependentValidators[$bank->getValidationType()] = true;
         }
         throw $e;
     }
     $this->testedValidators[$bank->getValidationType()] = true;
 }