Completed
Push — master ( 0086f4...1f95f1 )
by Aimeos
01:25
created
lib/custom/tests/TestHelper.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -42,6 +42,9 @@
 block discarded – undo
42 42
 	}
43 43
 
44 44
 
45
+	/**
46
+	 * @param string $site
47
+	 */
45 48
 	private static function createContext( $site )
46 49
 	{
47 50
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 
14 14
 		$includepaths = $aimeos->getIncludePaths();
15 15
 		$includepaths[] = get_include_path();
16
-		set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
16
+		set_include_path(implode(PATH_SEPARATOR, $includepaths));
17 17
 	}
18 18
 
19 19
 
20
-	public static function getContext( $site = 'unittest' )
20
+	public static function getContext($site = 'unittest')
21 21
 	{
22
-		if( !isset( self::$context[$site] ) ) {
23
-			self::$context[$site] = self::createContext( $site );
22
+		if (!isset(self::$context[$site])) {
23
+			self::$context[$site] = self::createContext($site);
24 24
 		}
25 25
 
26 26
 		return clone self::$context[$site];
@@ -29,58 +29,58 @@  discard block
 block discarded – undo
29 29
 
30 30
 	private static function getAimeos()
31 31
 	{
32
-		if( !isset( self::$aimeos ) )
32
+		if (!isset(self::$aimeos))
33 33
 		{
34 34
 			require_once 'Bootstrap.php';
35
-			spl_autoload_register( 'Aimeos\Bootstrap::autoload' );
35
+			spl_autoload_register('Aimeos\Bootstrap::autoload');
36 36
 
37
-			$extdir = dirname( dirname( dirname( __DIR__ ) ) );
38
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
37
+			$extdir = dirname(dirname(dirname(__DIR__)));
38
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
39 39
 		}
40 40
 
41 41
 		return self::$aimeos;
42 42
 	}
43 43
 
44 44
 
45
-	private static function createContext( $site )
45
+	private static function createContext($site)
46 46
 	{
47 47
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
48 48
 		$aimeos = self::getAimeos();
49 49
 
50 50
 
51
-		$paths = $aimeos->getConfigPaths( 'mysql' );
52
-		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
51
+		$paths = $aimeos->getConfigPaths('mysql');
52
+		$paths[] = __DIR__.DIRECTORY_SEPARATOR.'config';
53 53
 
54
-		$conf = new \Aimeos\MW\Config\PHPArray( [], $paths );
55
-		$ctx->setConfig( $conf );
54
+		$conf = new \Aimeos\MW\Config\PHPArray([], $paths);
55
+		$ctx->setConfig($conf);
56 56
 
57 57
 
58
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
59
-		$ctx->setDatabaseManager( $dbm );
58
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
59
+		$ctx->setDatabaseManager($dbm);
60 60
 
61 61
 
62
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
63
-		$ctx->setLogger( $logger );
62
+		$logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG);
63
+		$ctx->setLogger($logger);
64 64
 
65 65
 
66 66
 		$cache = new \Aimeos\MW\Cache\None();
67
-		$ctx->setCache( $cache );
67
+		$ctx->setCache($cache);
68 68
 
69 69
 
70
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
71
-		$ctx->setI18n( array( 'de' => $i18n ) );
70
+		$i18n = new \Aimeos\MW\Translation\None('de');
71
+		$ctx->setI18n(array('de' => $i18n));
72 72
 
73 73
 
74 74
 		$session = new \Aimeos\MW\Session\None();
75
-		$ctx->setSession( $session );
75
+		$ctx->setSession($session);
76 76
 
77 77
 
78
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $ctx );
79
-		$localeItem = $localeManager->bootstrap( $site, '', '', false );
78
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create($ctx);
79
+		$localeItem = $localeManager->bootstrap($site, '', '', false);
80 80
 
81
-		$ctx->setLocale( $localeItem );
81
+		$ctx->setLocale($localeItem);
82 82
 
83
-		$ctx->setEditor( 'ai-gettext:unittest' );
83
+		$ctx->setEditor('ai-gettext:unittest');
84 84
 
85 85
 		return $ctx;
86 86
 	}
Please login to merge, or discard this patch.