1 | <?php |
||
9 | class TestHelper |
||
10 | { |
||
11 | private static $aimeos; |
||
12 | private static $context = []; |
||
13 | |||
14 | |||
15 | public static function bootstrap() |
||
22 | } |
||
23 | |||
24 | |||
25 | public static function getContext( $site = 'unittest' ) |
||
26 | { |
||
27 | if( !isset( self::$context[$site] ) ) { |
||
28 | self::$context[$site] = self::createContext( $site ); |
||
29 | } |
||
30 | |||
31 | return clone self::$context[$site]; |
||
32 | } |
||
33 | |||
34 | |||
35 | private static function getAimeos() |
||
36 | { |
||
37 | if( !isset( self::$aimeos ) ) |
||
38 | { |
||
39 | require_once 'Bootstrap.php'; |
||
40 | spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
||
41 | |||
42 | $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
||
43 | self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
||
44 | } |
||
45 | |||
46 | return self::$aimeos; |
||
47 | } |
||
48 | |||
49 | |||
50 | private static function createContext( $site ) |
||
87 | } |
||
88 | } |
||
89 |