Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class TestHelper |
||
10 | { |
||
11 | private static $config; |
||
12 | private static $dbm; |
||
13 | |||
14 | |||
15 | /** |
||
16 | * Returns the configuration object |
||
17 | * |
||
18 | * @return \Aimeos\Base\Config\Iface Configuration object |
||
19 | */ |
||
20 | public static function getConfig() : \Aimeos\Base\Config\Iface |
||
27 | } |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Returns the database connection object |
||
32 | * |
||
33 | * @return \Aimeos\Base\DB\Connection\Iface Database connection object |
||
34 | */ |
||
35 | public static function getConnection() : \Aimeos\Base\DB\Connection\Iface |
||
36 | { |
||
37 | if( !isset( self::$dbm ) ) { |
||
38 | self::$dbm = new \Aimeos\Base\DB\Manager\Standard( self::getConfig()->get( 'resource', [] ), 'DBAL' ); |
||
39 | } |
||
40 | |||
41 | return self::$dbm->get(); |
||
42 | } |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Creates a new configuration object |
||
47 | * |
||
48 | * @return \Aimeos\Base\Config\Iface Configuration object |
||
49 | */ |
||
50 | private static function createConfig() : \Aimeos\Base\Config\Iface |
||
59 | } |
||
60 | } |
||
61 |