ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractPDOTest.php
Go to the documentation of this file.
1<?php
2
4
6
8
9 function setUp() {
10
11 $this->dropTables('users');
12 $this->createSchema('users');
13
14 $this->getPDO()->query(
15 "INSERT INTO users (username,digesta1) VALUES ('user','hash')"
16
17 );
18
19 }
20
21 function testConstruct() {
22
23 $pdo = $this->getPDO();
24 $backend = new PDO($pdo);
25 $this->assertTrue($backend instanceof PDO);
26
27 }
28
32 function testUserInfo() {
33
34 $pdo = $this->getPDO();
35 $backend = new PDO($pdo);
36
37 $this->assertNull($backend->getDigestHash('realm', 'blabla'));
38
39 $expected = 'hash';
40
41 $this->assertEquals($expected, $backend->getDigestHash('realm', 'user'));
42
43 }
44
45}
An exception for terminatinating execution or to throw for unit testing.
This is an authentication backend that uses a database to manage passwords.
Definition: PDO.php:12
$pdo
Definition: migrateto20.php:62
trait DbTestHelperTrait
dropTables($tableNames)
Drops tables, if they exist.
getPDO()
Alias for getDb.
createSchema($schemaName)
Uses .sql files from the examples directory to initialize the database.