/** * 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; } }
/** * 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); } } }
/** * 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); }