本文整理汇总了PHP中Bank::isValid方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::isValid方法的具体用法?PHP Bank::isValid怎么用?PHP Bank::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::isValid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValidAccount
/**
* Returns true if the account is valid for the current context.
*
* You have to have called isValidBank() before! If the current context
* is no valid bank every account will validate to true.
*
* @param string $account
* @see isValidBank()
* @see Bank::isValid()
* @throws InvalidContextException isValidBank() was not called before.
* @return bool
*/
public function isValidAccount($account)
{
if (!$this->initialized) {
throw new InvalidContextException("You have to call isValidBank() before.");
}
// No valid bank makes every account valid
if ($this->bank == null) {
return true;
}
return $this->bank->isValid($account);
}
示例2: isValid
/**
* @param int $bankCode
* @param int $account
* @return bool
* @throws BankNotFoundTestAPIException
*/
protected function isValid(Bank $bank, $account)
{
try {
return $bank->isValid($account);
} catch (Exception $e) {
echo $e->getMessage(), "\n", $e->getTraceAsString();
exit(1);
}
}
示例3: testWarningForIsValidWithInt
/**
* Validator::isValid() with an int should raise a warning.
*
* @see Validator::isValid()
* @dataProvider provideBanks
* @expectedException PHPUnit_Framework_Error_Warning
*/
public function testWarningForIsValidWithInt(Bank $bank)
{
$intAccount = 020012357;
$bank->isValid($intAccount);
}