File: TestCase.php

package info (click to toggle)
php-horde-sesha 1.0.0~rc3-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 960 kB
  • sloc: php: 1,887; xml: 386; makefile: 18; sh: 3
file content (41 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
 * @author     Ralf Lang <lang@ralf-lang.de>
 * @license    http://www.horde.org/licenses/gpl GPL
 * @category   Horde
 * @package    Sesha
 * @subpackage UnitTests
 */
class Sesha_TestCase extends Horde_Test_Case
{
    /**
     * The prepared backend driver
     *
     * @var Sesha_Driver
     */

    protected static $db;
    protected static $driver;
    protected static $migrator;
    protected static $injector;

    public static function setUpBeforeClass(): void
    {
        self::$injector = new Horde_Injector(new Horde_Injector_TopLevel());
        self::$db = new Horde_Db_Adapter_Pdo_Sqlite(array('dbname' => ':memory:'));
        self::$migrator = new Horde_Db_Migration_Migrator(
            self::$db,
            null,//$logger,
            array('migrationsPath' => __DIR__ . '/../../migration',
                  'schemaTableName' => 'sesha_test_schema'));
        self::$migrator->up();
        $driver_factory         = new Sesha_Factory_Driver(self::$injector);
        self::$driver = $driver_factory->create('Rdo',
                            array(
                                'db' => self::$db,
                                'driver' => 'Rdo'
                            )
                        );
    }

}