本文整理汇总了PHP中Bank::sjekkLoggInn方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::sjekkLoggInn方法的具体用法?PHP Bank::sjekkLoggInn怎么用?PHP Bank::sjekkLoggInn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::sjekkLoggInn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testfeilInnlogging
public function testfeilInnlogging()
{
$personnummer = "01010122344";
$passord = "1234566";
$bank = new Bank(new DBStubSqlite());
$OK = $bank->sjekkLoggInn($personnummer, $passord);
$this->assertEquals("Feil", $OK);
}
示例2: testRiktigPersonnummer
function testRiktigPersonnummer()
{
$personnummer = "12345678901";
$passord = "passord";
$bank = new Bank(new DBStub());
$resultat = $bank->sjekkLoggInn($personnummer, $passord);
$this->assertEquals($resultat, "OK");
}
示例3: Bank
function testFeilPassord3()
{
// arrange
$bank = new Bank(new BankDBStub());
// act
$innlogging = $bank->sjekkLoggInn("11223312345", "1234567890abcdeABCDE12345678910");
// assert
$this->assertEquals("Feil i passord", $innlogging);
}
示例4: testAssertRegExp
function testAssertRegExp()
{
// Arrange
$personnummer = "11111111111111111111";
$passord = "asdf123";
$bank = new Bank(new DBStub());
// Act
$validateLogin = $bank->sjekkLoggInn($personnummer, $passord);
// Assert
$this->assertRegExp("/[0-9]{11}/", $personnummer);
}
示例5: testPassordMaksTegn
public function testPassordMaksTegn()
{
// arrange
$personnummer = "12345678911";
$passord = "123456789123456789123456789123456789";
$bank = new Bank(new DBStub());
// act
$res = $bank->sjekkLoggInn($personnummer, $passord);
// assert
$this->assertEquals("Feil", $res);
}
示例6: Bank
<?php
//session_set_cookie_params(3600, $httponly = true);
session_start();
require __DIR__ . '/../BLL/Bank.php';
header('Content-Type: application/json');
if (isset($_GET['test'])) {
$bank = new Bank(new BankDatabaseStub());
// ved å legge på en test til slutt på tx!
} else {
$bank = new Bank();
}
$personnummer = $_GET['personnummer'];
$passord = $_GET['passord'];
$OK = $bank->sjekkLoggInn($personnummer, $passord);
if ($OK === 'OK') {
session_regenerate_id();
$_SESSION['loggetInn'] = $personnummer;
echo json_encode($OK);
} else {
unset($_SESSION['loggetInn']);
echo json_encode('Feil i innlogging');
}
示例7: testSjekkLoggInnPregPassordForLangt
public function testSjekkLoggInnPregPassordForLangt()
{
//arrange
$bankLogikk = new Bank(new DBStub());
$kunde = new kunde();
$kunde->personnummer = "01016522344";
$kunde->fornavn = "Kari";
$kunde->etternavn = "Olsen";
$kunde->adresse = "Jallaveien 69";
$kunde->postnr = "6969";
$kunde->poststed = "Oslo";
$kunde->telefonnr = "23657493";
$kunde->passord = "KariOlsen65Jallaveien69Oslo23657493";
//act
$OK = $bankLogikk->sjekkLoggInn($kunde->personnummer, $kunde->passord);
//assert
$this->assertEquals("Feil i passord", $OK);
}
示例8: testSjekkLoggInn_TomInputfields
/**
* @author Kristian Ulvund
* @version 1.0, 2016.01.11
*
* Denne testen sender inn tomme felt.
* @assert string "Feil i personnummer".
*/
public function testSjekkLoggInn_TomInputfields()
{
// Arrange
$personnummer = "";
$passord = "";
$bank = new Bank(new DBStub());
// Act
$loggInn = $bank->sjekkLoggInn($personnummer, $passord);
// Assert
$this->assertEquals("Feil i personnummer", $loggInn);
}
示例9: testSjekkLogginGyldig
public function testSjekkLogginGyldig()
{
$pnr = '12345678901';
$passord = 'heisann';
//samme passord i bankDBStub
$bank = new Bank(new BankDatabaseStub());
$return = $bank->sjekkLoggInn($pnr, $passord);
static::assertEquals($return, 'OK');
}