ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractPDOTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Auth\Backend;
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 }
getPDO()
Alias for getDb.
dropTables($tableNames)
Drops tables, if they exist.
createSchema($schemaName)
Uses .sql files from the examples directory to initialize the database.
trait DbTestHelperTrait
$pdo
Definition: migrateto20.php:62