1 | <?php |
||
4 | class TestHelper |
||
5 | { |
||
6 | private static $aimeos; |
||
7 | private static $context = []; |
||
8 | |||
9 | |||
10 | public static function bootstrap() |
||
17 | } |
||
18 | |||
19 | |||
20 | public static function getContext( $site = 'unittest' ) |
||
21 | { |
||
22 | if( !isset( self::$context[$site] ) ) { |
||
23 | self::$context[$site] = self::createContext( $site ); |
||
24 | } |
||
25 | |||
26 | return clone self::$context[$site]; |
||
27 | } |
||
28 | |||
29 | |||
30 | private static function getAimeos() |
||
31 | { |
||
32 | if( !isset( self::$aimeos ) ) |
||
33 | { |
||
34 | require_once 'Bootstrap.php'; |
||
35 | spl_autoload_register( 'Aimeos\Bootstrap::autoload' ); |
||
36 | |||
37 | $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
||
38 | self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
||
39 | } |
||
40 | |||
41 | return self::$aimeos; |
||
42 | } |
||
43 | |||
44 | |||
45 | private static function createContext( $site ) |
||
86 | } |
||
87 | } |
||
88 |