本文整理汇总了PHP中Bank::getValidationType方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::getValidationType方法的具体用法?PHP Bank::getValidationType怎么用?PHP Bank::getValidationType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::getValidationType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ignoreTestCase
/**
* Return true for known false positives.
*
* @return true
*/
public function ignoreTestCase(Bank $bank, $account)
{
// http://sourceforge.net/p/kontocheck/bugs/11/
if ($bank->getBankID() == "80063508") {
return true;
}
// http://sourceforge.net/p/kontocheck/bugs/12/
if ($bank->getValidationType() == "90") {
return true;
}
return parent::ignoreTestCase($bank, $account);
}
示例2: ignoreTestCase
/**
* Return true for known false positives.
*
* Version 1.45 has many false positives.
*
* @return true
*/
public function ignoreTestCase(Bank $bank, $account)
{
if ($account == 0) {
return true;
}
/* In version 1.45 those do differ:
*
* bank: 28570092 method: 63 account: 5 bav: valid kc: valid ktoblzcheck: invalid
* bank: 76026000 method: C7 account: 5 bav: valid kc: valid ktoblzcheck: invalid
* bank: 30022000 method: 08 account: 5 bav: invalid kc: invalid ktoblzcheck: valid
* bank: 80063508 method: 09 account: 30 bav: valid ktoblzcheck: invalid
* bank: 22230023 method: 68 account: 26 bav: invalid kc: invalid ktoblzcheck: valid
* AccountNumberCheck::check: Specified method 'E1' is unknown
* bank: 36050105 method: 78 account: 30 bav: invalid kc: invalid ktoblzcheck: valid
*/
$falsePositives = array("63", "C7", "08", "09", "68", "E1", "78");
if (in_array($bank->getValidationType(), array($falsePositives))) {
return true;
}
return parent::ignoreTestCase($bank, $account);
}
示例3: build
/**
* Builds a validator for a bank.
*
* @return Validator
* @see Bank::getValidationType()
* @see Bank::getValidator()
*/
public function build(Bank $bank)
{
$class = sprintf('%s\\Validator%s', __NAMESPACE__, $bank->getValidationType());
return new $class($bank);
}
示例4: getErrorMessage
/**
* @param Bank $bank
* @param String $account
* @param array $results
* @return String
*/
private function getErrorMessage(Bank $bank, $account, array $results)
{
$resultTranslation = array(TestAPIResult::VALID => "valid", TestAPIResult::INVALID => "invalid", TestAPIResult::ERROR => "error");
$message = "bank: {$bank->getBankID()} method: {$bank->getValidationType()} account: {$account}";
foreach ($results as $result) {
$message .= " {$result->getTestAPI()->getName()}: " . $resultTranslation[$result->getResult()];
if ($result instanceof TestAPIErrorResult) {
$message .= " {$result->getMessage()}";
}
}
return $message;
}
示例5: testNullIsInvalid
/**
* 0 - 0000000000 should always be invalid
*
* @param String $validatorType
* @throws ClassFileIOException
* @throws MissingClassException
* @dataProvider provideBanks
*/
public function testNullIsInvalid(Bank $bank)
{
for ($length = 0; $length <= 10; $length++) {
$account = str_pad("0", $length, "0", STR_PAD_LEFT);
$this->assertFalse($bank->isValid($account), "{$bank->getBankID()}/{$bank->getValidationType()} {$account} should be invalid.");
}
}