@@ -16,39 +16,39 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelper::getContext(), 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::create(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | 20 | |
21 | - $listManager = $manager->getSubManager( 'property', 'Ezpublish' ); |
|
22 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
21 | + $listManager = $manager->getSubManager('property', 'Ezpublish'); |
|
22 | + $this->object = $listManager->getSubManager('type', 'Ezpublish'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - unset( $this->object ); |
|
28 | + unset($this->object); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCleanup() |
33 | 33 | { |
34 | - $this->object->cleanup( array( -1 ) ); |
|
34 | + $this->object->cleanup(array( -1 )); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetSearchAttributes() |
39 | 39 | { |
40 | 40 | $attributes = $this->object->getSearchAttributes(); |
41 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
41 | + $this->assertGreaterThan(0, count($attributes)); |
|
42 | 42 | |
43 | - foreach( $attributes as $attribute ) { |
|
44 | - $this->assertInstanceOf( \Aimeos\MW\Criteria\Attribute\Iface::class, $attribute ); |
|
43 | + foreach ($attributes as $attribute) { |
|
44 | + $this->assertInstanceOf(\Aimeos\MW\Criteria\Attribute\Iface::class, $attribute); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetSubManager() |
50 | 50 | { |
51 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
52 | - $this->object->getSubManager( 'unknown' ); |
|
51 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
52 | + $this->object->getSubManager('unknown'); |
|
53 | 53 | } |
54 | 54 | } |
@@ -16,47 +16,47 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelper::getContext(), 'Ezpublish' ); |
|
20 | - $this->object = $manager->getSubManager( 'property', 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::create(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | + $this->object = $manager->getSubManager('property', 'Ezpublish'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - unset( $this->object ); |
|
26 | + unset($this->object); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testCleanup() |
31 | 31 | { |
32 | - $this->object->cleanup( array( -1 ) ); |
|
32 | + $this->object->cleanup(array( -1 )); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testGetSearchAttributes() |
37 | 37 | { |
38 | 38 | $attributes = $this->object->getSearchAttributes(); |
39 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
39 | + $this->assertGreaterThan(0, count($attributes)); |
|
40 | 40 | |
41 | - foreach( $attributes as $attribute ) { |
|
42 | - $this->assertInstanceOf( \Aimeos\MW\Criteria\Attribute\Iface::class, $attribute ); |
|
41 | + foreach ($attributes as $attribute) { |
|
42 | + $this->assertInstanceOf(\Aimeos\MW\Criteria\Attribute\Iface::class, $attribute); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testGetSubManager() |
48 | 48 | { |
49 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); |
|
49 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); |
|
50 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); |
|
51 | 51 | |
52 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
53 | - $this->object->getSubManager( 'unknown' ); |
|
52 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
53 | + $this->object->getSubManager('unknown'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testSaveItemInvalidItem() |
58 | 58 | { |
59 | - $this->setExpectedException( \Aimeos\MW\Common\Exception::class ); |
|
60 | - $this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.property.type.' ) ); |
|
59 | + $this->setExpectedException(\Aimeos\MW\Common\Exception::class); |
|
60 | + $this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.property.type.')); |
|
61 | 61 | } |
62 | 62 | } |
@@ -16,39 +16,39 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelper::getContext(), 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::create(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | 20 | |
21 | - $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
22 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
21 | + $listManager = $manager->getSubManager('lists', 'Ezpublish'); |
|
22 | + $this->object = $listManager->getSubManager('type', 'Ezpublish'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - unset( $this->object ); |
|
28 | + unset($this->object); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCleanup() |
33 | 33 | { |
34 | - $this->object->cleanup( array( -1 ) ); |
|
34 | + $this->object->cleanup(array( -1 )); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetSearchAttributes() |
39 | 39 | { |
40 | 40 | $attributes = $this->object->getSearchAttributes(); |
41 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
41 | + $this->assertGreaterThan(0, count($attributes)); |
|
42 | 42 | |
43 | - foreach( $attributes as $attribute ) { |
|
44 | - $this->assertInstanceOf( \Aimeos\MW\Criteria\Attribute\Iface::class, $attribute ); |
|
43 | + foreach ($attributes as $attribute) { |
|
44 | + $this->assertInstanceOf(\Aimeos\MW\Criteria\Attribute\Iface::class, $attribute); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetSubManager() |
50 | 50 | { |
51 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
52 | - $this->object->getSubManager( 'unknown' ); |
|
51 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
52 | + $this->object->getSubManager('unknown'); |
|
53 | 53 | } |
54 | 54 | } |
@@ -16,57 +16,57 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelper::getContext(), 'Ezpublish' ); |
|
20 | - $this->object = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::create(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | + $this->object = $manager->getSubManager('lists', 'Ezpublish'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - unset( $this->object ); |
|
26 | + unset($this->object); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testCleanup() |
31 | 31 | { |
32 | - $this->object->cleanup( array( -1 ) ); |
|
32 | + $this->object->cleanup(array( -1 )); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testGetSearchAttributes() |
37 | 37 | { |
38 | 38 | $attributes = $this->object->getSearchAttributes(); |
39 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
39 | + $this->assertGreaterThan(0, count($attributes)); |
|
40 | 40 | |
41 | - foreach( $attributes as $attribute ) { |
|
42 | - $this->assertInstanceOf( \Aimeos\MW\Criteria\Attribute\Iface::class, $attribute ); |
|
41 | + foreach ($attributes as $attribute) { |
|
42 | + $this->assertInstanceOf(\Aimeos\MW\Criteria\Attribute\Iface::class, $attribute); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testGetSubManager() |
48 | 48 | { |
49 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); |
|
49 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); |
|
50 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); |
|
51 | 51 | |
52 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
53 | - $this->object->getSubManager( 'unknown' ); |
|
52 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
53 | + $this->object->getSubManager('unknown'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testSaveItemInvalidItem() |
58 | 58 | { |
59 | - $this->setExpectedException( \Aimeos\MW\Common\Exception::class ); |
|
60 | - $this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) ); |
|
59 | + $this->setExpectedException(\Aimeos\MW\Common\Exception::class); |
|
60 | + $this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.lists.type.')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testSaveItemInvalidDomain() |
65 | 65 | { |
66 | 66 | $item = $this->object->createItem(); |
67 | - $item->setDomain( 'customer/group' ); |
|
67 | + $item->setDomain('customer/group'); |
|
68 | 68 | |
69 | - $this->setExpectedException( \Aimeos\MShop\Customer\Exception::class ); |
|
70 | - $this->object->saveItem( $item ); |
|
69 | + $this->setExpectedException(\Aimeos\MShop\Customer\Exception::class); |
|
70 | + $this->object->saveItem($item); |
|
71 | 71 | } |
72 | 72 | } |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $includepaths = $aimeos->getIncludePaths(); |
20 | 20 | $includepaths[] = get_include_path(); |
21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | - public static function getContext( $site = 'unittest' ) |
|
25 | + public static function getContext($site = 'unittest') |
|
26 | 26 | { |
27 | - if( !isset( self::$context[$site] ) ) { |
|
28 | - self::$context[$site] = self::createContext( $site ); |
|
27 | + if (!isset(self::$context[$site])) { |
|
28 | + self::$context[$site] = self::createContext($site); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return clone self::$context[$site]; |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | private static function getAimeos() |
36 | 36 | { |
37 | - if( !isset( self::$aimeos ) ) |
|
37 | + if (!isset(self::$aimeos)) |
|
38 | 38 | { |
39 | 39 | require_once 'Bootstrap.php'; |
40 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
40 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
41 | 41 | |
42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
42 | + $extdir = dirname(dirname(dirname(__DIR__))); |
|
43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return self::$aimeos; |
@@ -50,45 +50,45 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @param string $site |
52 | 52 | */ |
53 | - private static function createContext( $site ) |
|
53 | + private static function createContext($site) |
|
54 | 54 | { |
55 | 55 | $ctx = new \Aimeos\MShop\Context\Item\Ezpublish(); |
56 | 56 | $aimeos = self::getAimeos(); |
57 | 57 | |
58 | 58 | |
59 | 59 | $paths = $aimeos->getConfigPaths(); |
60 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
60 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
61 | 61 | |
62 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
|
63 | - $ctx->setConfig( $conf ); |
|
62 | + $conf = new \Aimeos\MW\Config\PHPArray([], $paths); |
|
63 | + $ctx->setConfig($conf); |
|
64 | 64 | |
65 | 65 | |
66 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf ); |
|
67 | - $ctx->setDatabaseManager( $dbm ); |
|
66 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($conf); |
|
67 | + $ctx->setDatabaseManager($dbm); |
|
68 | 68 | |
69 | 69 | |
70 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
71 | - $ctx->setLogger( $logger ); |
|
70 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
71 | + $ctx->setLogger($logger); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | $cache = new \Aimeos\MW\Cache\None(); |
75 | - $ctx->setCache( $cache ); |
|
75 | + $ctx->setCache($cache); |
|
76 | 76 | |
77 | 77 | |
78 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
79 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
78 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
79 | + $ctx->setI18n(array('de' => $i18n)); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | $session = new \Aimeos\MW\Session\None(); |
83 | - $ctx->setSession( $session ); |
|
83 | + $ctx->setSession($session); |
|
84 | 84 | |
85 | 85 | |
86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $ctx ); |
|
87 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::create($ctx); |
|
87 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
88 | 88 | |
89 | - $ctx->setLocale( $localeItem ); |
|
89 | + $ctx->setLocale($localeItem); |
|
90 | 90 | |
91 | - $ctx->setEditor( 'ai-ezpublish:unittest' ); |
|
91 | + $ctx->setEditor('ai-ezpublish:unittest'); |
|
92 | 92 | |
93 | 93 | return $ctx; |
94 | 94 | } |