first commit
This commit is contained in:
63
tests/functional/AliveTest.php
Normal file
63
tests/functional/AliveTest.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Honza
|
||||
* Date: 21/7/16
|
||||
* Time: 9:47 AM.
|
||||
*/
|
||||
class AliveTest extends DatabaseTestCase
|
||||
{
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
if (!findModule('alive')) {
|
||||
self::markTestSkipped('Modul alive je vypnutý.');
|
||||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
{
|
||||
$aliveCard = new AliveCard();
|
||||
|
||||
$connection = $aliveCard->connect();
|
||||
|
||||
$this->assertNotFalse($connection);
|
||||
}
|
||||
|
||||
public function testTestServer()
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
$old_cfg = $cfg;
|
||||
|
||||
$cfg['Modules']['isic'] = [
|
||||
'url' => 'https://gts-dm.orchitech.net/api',
|
||||
'username' => 'testdm',
|
||||
'password' => 'testdm',
|
||||
];
|
||||
$name = 'Přemysll Žluťoučký';
|
||||
$card = 'T042532100344J';
|
||||
|
||||
$aliveCard = new AliveCard();
|
||||
|
||||
$info = $aliveCard->validate($card, $name);
|
||||
|
||||
$cfg = $old_cfg;
|
||||
$this->assertNotFalse($info);
|
||||
}
|
||||
|
||||
public function testRealServer()
|
||||
{
|
||||
$name = 'PROKOP Jan';
|
||||
$card = 'S420562002829G';
|
||||
|
||||
// $name = "Jakub Jirouš";
|
||||
// $card = "S420562000568G";
|
||||
|
||||
$aliveCard = new AliveCard();
|
||||
|
||||
$info = $aliveCard->validate($card, $name);
|
||||
|
||||
$this->assertNotFalse($info);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user