@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | |
18 | 18 | $includepaths = $mshop->getIncludePaths(); |
19 | 19 | $includepaths[] = get_include_path(); |
20 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
20 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | - public static function getContext( $site = 'unittest' ) |
|
24 | + public static function getContext($site = 'unittest') |
|
25 | 25 | { |
26 | - if( !isset( self::$context[$site] ) ) { |
|
27 | - self::$context[$site] = self::createContext( $site ); |
|
26 | + if (!isset(self::$context[$site])) { |
|
27 | + self::$context[$site] = self::createContext($site); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | return clone self::$context[$site]; |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | |
34 | 34 | private static function getAimeos() |
35 | 35 | { |
36 | - if( !isset( self::$aimeos ) ) |
|
36 | + if (!isset(self::$aimeos)) |
|
37 | 37 | { |
38 | 38 | require_once 'Bootstrap.php'; |
39 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
39 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
40 | 40 | |
41 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
42 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
41 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
42 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return self::$aimeos; |
@@ -52,31 +52,31 @@ discard block |
||
52 | 52 | * @param string $site Unique site code |
53 | 53 | * @return \\Aimeos\MShop\Context\Item\Iface Context object |
54 | 54 | */ |
55 | - private static function createContext( $site ) |
|
55 | + private static function createContext($site) |
|
56 | 56 | { |
57 | 57 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
58 | 58 | $mshop = self::getAimeos(); |
59 | 59 | |
60 | 60 | |
61 | - $paths = $mshop->getConfigPaths( 'mysql' ); |
|
62 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
61 | + $paths = $mshop->getConfigPaths('mysql'); |
|
62 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
63 | 63 | |
64 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
65 | - $ctx->setConfig( $conf ); |
|
64 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
65 | + $ctx->setConfig($conf); |
|
66 | 66 | |
67 | 67 | |
68 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
69 | - $ctx->setDatabaseManager( $dbm ); |
|
68 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
69 | + $ctx->setDatabaseManager($dbm); |
|
70 | 70 | |
71 | 71 | |
72 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
73 | - $ctx->setLogger( $logger ); |
|
72 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
73 | + $ctx->setLogger($logger); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | $session = new \Aimeos\MW\Session\None(); |
77 | - $ctx->setSession( $session ); |
|
77 | + $ctx->setSession($session); |
|
78 | 78 | |
79 | - $ctx->setEditor( 'ai-flow:unittest' ); |
|
79 | + $ctx->setEditor('ai-flow:unittest'); |
|
80 | 80 | |
81 | 81 | return $ctx; |
82 | 82 | } |
@@ -17,38 +17,38 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if( class_exists( 'Neos\Cache\Frontend\StringFrontend' ) === false ) { |
|
21 | - $this->markTestSkipped( 'Class \\Neos\\Cache\\Frontend\\StringFrontend not found' ); |
|
20 | + if (class_exists('Neos\Cache\Frontend\StringFrontend') === false) { |
|
21 | + $this->markTestSkipped('Class \\Neos\\Cache\\Frontend\\StringFrontend not found'); |
|
22 | 22 | } |
23 | 23 | |
24 | - $localeItem = $this->getMockBuilder( '\Aimeos\MShop\Locale\Item\Standard' ) |
|
25 | - ->setMethods( ['getSiteId']) |
|
24 | + $localeItem = $this->getMockBuilder('\Aimeos\MShop\Locale\Item\Standard') |
|
25 | + ->setMethods(['getSiteId']) |
|
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->mock = $this->getMockBuilder( 'Neos\Cache\Frontend\StringFrontend' ) |
|
28 | + $this->mock = $this->getMockBuilder('Neos\Cache\Frontend\StringFrontend') |
|
29 | 29 | ->disableOriginalConstructor() |
30 | 30 | ->getMock(); |
31 | 31 | |
32 | 32 | $context = \TestHelper::getContext(); |
33 | - $context->setLocale( $localeItem ); |
|
33 | + $context->setLocale($localeItem); |
|
34 | 34 | |
35 | - $this->object = new \Aimeos\MAdmin\Cache\Proxy\Flow( $context, $this->mock ); |
|
35 | + $this->object = new \Aimeos\MAdmin\Cache\Proxy\Flow($context, $this->mock); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | protected function tearDown() |
40 | 40 | { |
41 | - unset( $this->mock, $this->object ); |
|
41 | + unset($this->mock, $this->object); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testGetObject() |
46 | 46 | { |
47 | - $class = new \ReflectionClass( '\Aimeos\MAdmin\Cache\Proxy\Flow' ); |
|
48 | - $method = $class->getMethod( 'getObject' ); |
|
49 | - $method->setAccessible( true ); |
|
47 | + $class = new \ReflectionClass('\Aimeos\MAdmin\Cache\Proxy\Flow'); |
|
48 | + $method = $class->getMethod('getObject'); |
|
49 | + $method->setAccessible(true); |
|
50 | 50 | |
51 | - $result = $method->invokeArgs( $this->object, [] ); |
|
52 | - $this->assertInstanceOf( '\Aimeos\MW\Cache\Iface', $result ); |
|
51 | + $result = $method->invokeArgs($this->object, []); |
|
52 | + $this->assertInstanceOf('\Aimeos\MW\Cache\Iface', $result); |
|
53 | 53 | } |
54 | 54 | } |