本文整理汇总了PHP中Bank类的典型用法代码示例。如果您正苦于以下问题:PHP Bank类的具体用法?PHP Bank怎么用?PHP Bank使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bank类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaldiArray
public function testSaldiArray()
{
// arrange
$personnummer = "123";
$konti = array();
$konto = new konto();
$konto->personnummer = $personnummer;
$konto->kontonummer = "123123123";
$konto->type = "Sparekonto";
$konto->saldo = 2300.34;
$konto->valuta = "NOK";
$konti[0] = $konto;
$konto1 = new konto();
$konto1->personnummer = $personnummer;
$konto1->kontonummer = "124123123";
$konto1->type = "BSUkonto";
$konto1->saldo = 2200.34;
$konto1->valuta = "NOK";
$konti[1] = $konto1;
$konto2 = new konto();
$konto2->personnummer = $personnummer;
$konto2->kontonummer = "124123123";
$konto2->type = "Brukskonto";
$konto2->saldo = 2200.34;
$konto2->valuta = "NOK";
$konti[2] = $konto2;
$bank = new Bank(new DBStub());
// act
$res = $bank->hentSaldi($personnummer);
// assert
$this->assertEquals($konti, $res);
}
示例2: testHentFlereBetalinger
public function testHentFlereBetalinger()
{
//Arrange
$bank = new Bank(new DBStubSqlite());
$personnummer = "11223344556";
//Act
$betalinger = $bank->hentBetalinger($personnummer);
//Assert
$this->assertEquals(3, count($betalinger));
$this->assertEquals("6", $betalinger[0]->TxID);
$this->assertEquals("12312345", $betalinger[0]->FraTilKontonummer);
$this->assertEquals("1234", $betalinger[0]->Belop);
$this->assertEquals("2012-12-12", $betalinger[0]->Dato);
$this->assertEquals("Melding", $betalinger[0]->Melding);
$this->assertEquals("234567", $betalinger[0]->Kontonummer);
$this->assertEquals("1", $betalinger[0]->Avventer);
$this->assertEquals("11", $betalinger[1]->TxID);
$this->assertEquals("12312345", $betalinger[1]->FraTilKontonummer);
$this->assertEquals("99.99", $betalinger[1]->Belop);
$this->assertEquals("2012-12-11", $betalinger[1]->Dato);
$this->assertEquals("Avgift på smørbrød til lucifer selv", $betalinger[1]->Melding);
$this->assertEquals("234567", $betalinger[1]->Kontonummer);
$this->assertEquals("1", $betalinger[1]->Avventer);
$this->assertEquals("3", $betalinger[2]->TxID);
$this->assertEquals("20102012345", $betalinger[2]->FraTilKontonummer);
$this->assertEquals("-1400.7", $betalinger[2]->Belop);
$this->assertEquals("2015-03-13", $betalinger[2]->Dato);
$this->assertEquals("Husleie", $betalinger[2]->Melding);
$this->assertEquals("55551166677", $betalinger[2]->Kontonummer);
$this->assertEquals("1", $betalinger[2]->Avventer);
}
示例3: testEndreUgyldigKunde
public function testEndreUgyldigKunde()
{
//Arrange
$bank = new Bank(new DBStubSqlite());
$kunde = new kunde();
$kunde->personnummer = "11122233312";
$kunde->fornavn = "Ugyldig";
$kunde->etternavn = "Person";
$kunde->adresse = "Luftslåttveien 22";
$kunde->postnr = "1387";
$kunde->poststed = "Asker";
$kunde->telefonnr = "22224444";
$kunde->passord = "11122233312";
//Act
$OK = $bank->hentKundeInfo($kunde->personnummer);
$this->assertEquals("Feil", $OK);
$oppdatertKunde = clone $kunde;
$oppdatertKunde->fornavn = "Lina";
$oppdatertKunde->etternavn = "Jonvik";
$oppdatertKunde->adresse = "Slaskebakken 22";
$OK = $bank->endreKundeInfo($oppdatertKunde);
$this->assertEquals("OK", $OK);
$OK = $bank->hentKundeInfo($kunde->personnummer);
$this->assertEquals("Feil", $OK);
}
示例4: _createNewBank
protected function _createNewBank($bank)
{
$model = new Bank();
$model->title = $bank['title'];
$model->position = $bank['pos'];
$model->license = $bank['license'];
$model->save();
}
示例5: testfeilInnlogging
public function testfeilInnlogging()
{
$personnummer = "01010122344";
$passord = "1234566";
$bank = new Bank(new DBStubSqlite());
$OK = $bank->sjekkLoggInn($personnummer, $passord);
$this->assertEquals("Feil", $OK);
}
示例6: testRiktigPersonnummer
function testRiktigPersonnummer()
{
$personnummer = "12345678901";
$passord = "passord";
$bank = new Bank(new DBStub());
$resultat = $bank->sjekkLoggInn($personnummer, $passord);
$this->assertEquals($resultat, "OK");
}
示例7: 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);
}
}
示例8: testBetalingIdTOM
public function testBetalingIdTOM()
{
//arrange
$bank = new Bank(new DBStub());
//act
$res = $bank->utforBetaling("");
//assert
$this->assertEquals("Feil", $res);
}
示例9: test_hentBetalinger_OK
public function test_hentBetalinger_OK()
{
//Arrange
$bank = new Bank(new BankDBStub());
//Act
$betalinger = $bank->hentBetalinger("16019312345");
//Assert
$this->assertEquals(2, count($betalinger));
}
示例10: testFeilPassord3
function testFeilPassord3()
{
// arrange
$bank = new Bank(new BankDBStub());
// act
$innlogging = $bank->sjekkLoggInn("11223312345", "1234567890abcdeABCDE12345678910");
// assert
$this->assertEquals("Feil i passord", $innlogging);
}
示例11: testHentKonto2
function testHentKonto2()
{
// Arrange
$personnummer = "11010110523";
$bank = new Bank(new DBStub());
// Act
$konti = $bank->hentKonti($personnummer);
// Assert
$this->assertEquals("", $konti);
}
示例12: testHentKundeInfo_FeilPostSted
/**
* @author Øyvind Ahlstrøm
* @version 1.1, 2016.01.26
*
* Denne testen sender et personnnummer som skal trigge "feil" i poststed.
* @assert string "Feil"s
*/
public function testHentKundeInfo_FeilPostSted()
{
// Arrange
$bank = new Bank(new DBStub());
$personnummer = "00000000001";
// Act
$resultat = $bank->hentKundeInfo($personnummer);
// Assert
$this->assertEquals("Feil postnr", $resultat);
}
示例13: testHentIngenSaldo
public function testHentIngenSaldo()
{
//Arrange
$bank = new Bank(new DBStub());
$personnummer = '10987654321';
//Act
$saldo = $bank->hentSaldi($personnummer);
//Assert
$this->assertEmpty($saldo);
}
示例14: testEndreKundeInfoMedUgyldigObjekt
public function testEndreKundeInfoMedUgyldigObjekt()
{
// Arrange
$kunde = new transaksjon();
$bank = new Bank(new DBStub());
// Act
$endreKundeInfo = $bank->endreKundeInfo($kunde);
// Assert
$this->assertEquals("Feil", $endreKundeInfo);
}
示例15: testUtforEnBetalingMedUgyldigTransaksjonsId
public function testUtforEnBetalingMedUgyldigTransaksjonsId()
{
// Arrange
$TxId = "111";
$bank = new Bank(new DBStub());
// Act
$utforBetaling = $bank->utforBetaling($TxId);
// Assert
$this->assertEquals("Feil", $utforBetaling);
}