本文整理汇总了PHP中Bank::hentKundeInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::hentKundeInfo方法的具体用法?PHP Bank::hentKundeInfo怎么用?PHP Bank::hentKundeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::hentKundeInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: testHentGyldigKunde
public function testHentGyldigKunde()
{
//Arrange
$bank = new Bank(new DBStubSqlite());
$personnummer = "09048433711";
//Act
$kunde = $bank->hentKundeInfo($personnummer);
//Assert
$this->assertInstanceOf("kunde", $kunde);
}
示例3: 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);
}
示例4: testHentEnKundeInfoMedUgyldigPersonnummer
public function testHentEnKundeInfoMedUgyldigPersonnummer()
{
// Arrange
$personnummer = "01010122340";
$bank = new Bank(new DBStub());
// Act
$hentKundeInfo = $bank->hentKundeInfo($personnummer);
// Assert
// Sjekker om det er ett array
$this->assertInternalType('array', $hentKundeInfo);
// Sjekker om array'et er tomt
$this->assertEmpty($hentKundeInfo);
}
示例5: testOk
public function testOk()
{
//arrange
$personnummer = "12504567891";
$kunde = new kunde();
$kunde->personnummer = $personnummer;
$kunde->fornavn = "Arne";
$kunde->etternavn = "Hansen";
$kunde->adresse = "Ljansbakken 20";
$kunde->telefonnr = "22222222";
$kunde->passord = "123456";
$kunde->postnr = substr($personnummer, 0, 4);
$kunde->poststed = "Oslo";
$bank = new Bank(new DBStub());
//act
$res = $bank->hentKundeInfo($personnummer);
//assert
$this->assertEquals($kunde, $res);
}
示例6: testHentKundeInfoIngenKundeMedPersonnummer
public function testHentKundeInfoIngenKundeMedPersonnummer()
{
//arrange
$bankLogikk = new Bank(new DBStub());
$personnummer = -010101234567;
//act
$kunde = $bankLogikk->hentKundeInfo($personnummer);
//assert
$this->assertEquals("Feil", $kunde);
}
示例7: testHentKundeInfo
public function testHentKundeInfo()
{
$bank = new Bank(new BankDatabaseStub());
$personnummer = "12345678945";
static::assertEquals($bank->hentKundeInfo($personnummer), "OK");
$personnummer = "12345678901";
static::assertEquals($bank->hentKundeInfo($personnummer), "Feil");
}