예제 #1
0
 /**
  * Returns true if a bank exists.
  *
  * This method sets the bank context and should be called first.
  *
  * @throws DataBackendException
  * @param string $bankID
  * @return bool
  * @see DataBackend::isValidBank()
  */
 public function isValidBank($bankID)
 {
     try {
         $this->initialized = true;
         $this->bank = $this->backend->getBank($bankID);
         return true;
     } catch (BankNotFoundException $e) {
         $this->bank = null;
         return false;
     }
 }
예제 #2
0
파일: BackendTest.php 프로젝트: bmdevel/bav
 /**
  * Tests loading all agencies
  * 
  * @dataProvider provideBackends
  */
 public function testAgencies(DataBackend $backend)
 {
     foreach (self::$referenceBackend->getAllBanks() as $referenceBank) {
         $testedBank = $backend->getBank($referenceBank->getBankID());
         $referenceAgencies = array();
         foreach ($referenceBank->getAgencies() as $agency) {
             $referenceAgencies[$agency->getID()] = $agency;
         }
         foreach ($testedBank->getAgencies() as $agency) {
             $referenceAgency = $referenceAgencies[$agency->getID()];
             $this->assertEqualAgency($referenceAgency, $agency);
         }
     }
 }
예제 #3
0
파일: BAV.php 프로젝트: bmdevel/bav
 /**
  * With this method you get the Bank objects for certain IDs. Note
  * that a call to this method with an identical id will return the same
  * objects.
  *
  * @throws BankNotFoundException
  * @throws DataBackendException
  * @param string $bankID
  * @return Bank
  * @see DataBackend::isValidBank()
  */
 public function getBank($bankID)
 {
     return $this->backend->getBank($bankID);
 }