@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value |
27 | 27 | * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor |
28 | 28 | */ |
29 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | - \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null ); |
|
29 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | + \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -37,5 +37,5 @@ discard block |
||
37 | 37 | * @param array $data List of CSV fields with position as key and data as value |
38 | 38 | * @return array List of data which hasn't been imported |
39 | 39 | */ |
40 | - public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ); |
|
40 | + public function process(\Aimeos\MShop\Product\Item\Iface $product, array $data); |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
26 | 26 | */ |
27 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ); |
|
27 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns the item or ID for the given code |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | * @param string|null $type Item type if used and required |
34 | 34 | * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found |
35 | 35 | */ |
36 | - public function get( $code, $type = null ); |
|
36 | + public function get($code, $type = null); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Adds the item or ID to the cache |
40 | 40 | * |
41 | 41 | * @param \Aimeos\MShop\Common\Item\Iface $item Item object |
42 | 42 | */ |
43 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ); |
|
43 | + public function set(\Aimeos\MShop\Common\Item\Iface $item); |
|
44 | 44 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * |
28 | 28 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
29 | 29 | */ |
30 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
31 | 31 | { |
32 | 32 | $this->context = $context; |
33 | 33 | } |
@@ -11,22 +11,22 @@ |
||
11 | 11 | * Set error reporting to maximum |
12 | 12 | */ |
13 | 13 | error_reporting( -1 ); |
14 | -ini_set( 'display_errors', '1' ); |
|
14 | +ini_set('display_errors', '1'); |
|
15 | 15 | |
16 | -date_default_timezone_set( 'UTC' ); |
|
16 | +date_default_timezone_set('UTC'); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Set locale settings to reasonable defaults |
20 | 20 | */ |
21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
22 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
24 | -setlocale( LC_TIME, 'POSIX' ); |
|
21 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
22 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
24 | +setlocale(LC_TIME, 'POSIX'); |
|
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Set include path for tests |
28 | 28 | */ |
29 | -define( 'PATH_TESTS', __DIR__ ); |
|
29 | +define('PATH_TESTS', __DIR__); |
|
30 | 30 | |
31 | 31 | require_once 'TestHelperCntl.php'; |
32 | 32 | \TestHelperCntl::bootstrap(); |
@@ -11,22 +11,22 @@ |
||
11 | 11 | * Set error reporting to maximum |
12 | 12 | */ |
13 | 13 | error_reporting( -1 ); |
14 | -ini_set( 'display_errors', '1' ); |
|
14 | +ini_set('display_errors', '1'); |
|
15 | 15 | |
16 | -date_default_timezone_set( 'UTC' ); |
|
16 | +date_default_timezone_set('UTC'); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Set locale settings to reasonable defaults |
20 | 20 | */ |
21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
22 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
24 | -setlocale( LC_TIME, 'POSIX' ); |
|
21 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
22 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
24 | +setlocale(LC_TIME, 'POSIX'); |
|
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Set include path for tests |
28 | 28 | */ |
29 | -define( 'PATH_TESTS', __DIR__ ); |
|
29 | +define('PATH_TESTS', __DIR__); |
|
30 | 30 | |
31 | 31 | require_once 'TestHelperJobs.php'; |
32 | 32 | \TestHelperJobs::bootstrap(); |
@@ -4,11 +4,11 @@ |
||
4 | 4 | 'jobs' => array( |
5 | 5 | 'product' => array( |
6 | 6 | 'export' => array( |
7 | - 'location' => dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'tmp', |
|
7 | + 'location' => dirname(__DIR__) . DIRECTORY_SEPARATOR . 'tmp', |
|
8 | 8 | 'max-items' => 15, |
9 | 9 | 'max-query' => 5, |
10 | 10 | 'sitemap' => array( |
11 | - 'location' => dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'tmp', |
|
11 | + 'location' => dirname(__DIR__) . DIRECTORY_SEPARATOR . 'tmp', |
|
12 | 12 | 'max-items' => 15, |
13 | 13 | 'max-query' => 5, |
14 | 14 | ), |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $context = \TestHelperJobs::getContext(); |
26 | 26 | $aimeos = \TestHelperJobs::getAimeos(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unpaid\Standard( $context, $aimeos ); |
|
28 | + $this->object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unpaid\Standard($context, $aimeos); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | |
44 | 44 | public function testGetName() |
45 | 45 | { |
46 | - $this->assertEquals( 'Removes unpaid orders', $this->object->getName() ); |
|
46 | + $this->assertEquals('Removes unpaid orders', $this->object->getName()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testGetDescription() |
51 | 51 | { |
52 | 52 | $text = 'Deletes unpaid orders to keep the database clean'; |
53 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
53 | + $this->assertEquals($text, $this->object->getDescription()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -61,47 +61,47 @@ discard block |
||
61 | 61 | |
62 | 62 | |
63 | 63 | $name = 'ControllerJobsOrderCleanupUnpaidDefaultRun'; |
64 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
65 | - $context->getConfig()->set( 'controller/common/order/name', $name ); |
|
64 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
65 | + $context->getConfig()->set('controller/common/order/name', $name); |
|
66 | 66 | |
67 | 67 | |
68 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
69 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
70 | - ->setConstructorArgs( array( $context ) ) |
|
68 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
69 | + ->setMethods(array('searchItems', 'getSubManager')) |
|
70 | + ->setConstructorArgs(array($context)) |
|
71 | 71 | ->getMock(); |
72 | 72 | |
73 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
74 | - ->setMethods( array( 'deleteItems' ) ) |
|
75 | - ->setConstructorArgs( array( $context ) ) |
|
73 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
74 | + ->setMethods(array('deleteItems')) |
|
75 | + ->setConstructorArgs(array($context)) |
|
76 | 76 | ->getMock(); |
77 | 77 | |
78 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
79 | - ->setMethods( array( 'unblock' ) ) |
|
80 | - ->setConstructorArgs( array( $context ) ) |
|
78 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
79 | + ->setMethods(array('unblock')) |
|
80 | + ->setConstructorArgs(array($context)) |
|
81 | 81 | ->getMock(); |
82 | 82 | |
83 | 83 | |
84 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
85 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
84 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
85 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
86 | 86 | |
87 | 87 | |
88 | 88 | $orderItem = $orderManagerStub->createItem(); |
89 | - $orderItem->setBaseId( 1 ); |
|
90 | - $orderItem->setId( 2 ); |
|
89 | + $orderItem->setBaseId(1); |
|
90 | + $orderItem->setId(2); |
|
91 | 91 | |
92 | 92 | |
93 | - $orderManagerStub->expects( $this->once() )->method( 'getSubManager' ) |
|
94 | - ->will( $this->returnValue( $orderBaseManagerStub ) ); |
|
93 | + $orderManagerStub->expects($this->once())->method('getSubManager') |
|
94 | + ->will($this->returnValue($orderBaseManagerStub)); |
|
95 | 95 | |
96 | - $orderManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
97 | - ->will( $this->returnValue( array( $orderItem->getId() => $orderItem ) ) ); |
|
96 | + $orderManagerStub->expects($this->once())->method('searchItems') |
|
97 | + ->will($this->returnValue(array($orderItem->getId() => $orderItem))); |
|
98 | 98 | |
99 | - $orderBaseManagerStub->expects( $this->once() )->method( 'deleteItems' ); |
|
99 | + $orderBaseManagerStub->expects($this->once())->method('deleteItems'); |
|
100 | 100 | |
101 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
101 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
102 | 102 | |
103 | 103 | |
104 | - $object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unpaid\Standard( $context, $aimeos ); |
|
104 | + $object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unpaid\Standard($context, $aimeos); |
|
105 | 105 | $object->run(); |
106 | 106 | } |
107 | 107 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $context = \TestHelperJobs::getContext(); |
26 | 26 | $aimeos = \TestHelperJobs::getAimeos(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unfinished\Standard( $context, $aimeos ); |
|
28 | + $this->object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unfinished\Standard($context, $aimeos); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | |
44 | 44 | public function testGetName() |
45 | 45 | { |
46 | - $this->assertEquals( 'Removes unfinished orders', $this->object->getName() ); |
|
46 | + $this->assertEquals('Removes unfinished orders', $this->object->getName()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testGetDescription() |
51 | 51 | { |
52 | 52 | $text = 'Deletes unfinished orders an makes their products and coupon codes available again'; |
53 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
53 | + $this->assertEquals($text, $this->object->getDescription()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -61,47 +61,47 @@ discard block |
||
61 | 61 | |
62 | 62 | |
63 | 63 | $name = 'ControllerJobsOrderCleanupUnfinishedDefaultRun'; |
64 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
65 | - $context->getConfig()->set( 'controller/common/order/name', $name ); |
|
64 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
65 | + $context->getConfig()->set('controller/common/order/name', $name); |
|
66 | 66 | |
67 | 67 | |
68 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
69 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
70 | - ->setConstructorArgs( array( $context ) ) |
|
68 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
69 | + ->setMethods(array('searchItems', 'getSubManager')) |
|
70 | + ->setConstructorArgs(array($context)) |
|
71 | 71 | ->getMock(); |
72 | 72 | |
73 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
74 | - ->setMethods( array( 'deleteItems' ) ) |
|
75 | - ->setConstructorArgs( array( $context ) ) |
|
73 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
74 | + ->setMethods(array('deleteItems')) |
|
75 | + ->setConstructorArgs(array($context)) |
|
76 | 76 | ->getMock(); |
77 | 77 | |
78 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
79 | - ->setMethods( array( 'unblock' ) ) |
|
80 | - ->setConstructorArgs( array( $context ) ) |
|
78 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
79 | + ->setMethods(array('unblock')) |
|
80 | + ->setConstructorArgs(array($context)) |
|
81 | 81 | ->getMock(); |
82 | 82 | |
83 | 83 | |
84 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
85 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
84 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
85 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
86 | 86 | |
87 | 87 | |
88 | 88 | $orderItem = $orderManagerStub->createItem(); |
89 | - $orderItem->setBaseId( 1 ); |
|
90 | - $orderItem->setId( 2 ); |
|
89 | + $orderItem->setBaseId(1); |
|
90 | + $orderItem->setId(2); |
|
91 | 91 | |
92 | 92 | |
93 | - $orderManagerStub->expects( $this->once() )->method( 'getSubManager' ) |
|
94 | - ->will( $this->returnValue( $orderBaseManagerStub ) ); |
|
93 | + $orderManagerStub->expects($this->once())->method('getSubManager') |
|
94 | + ->will($this->returnValue($orderBaseManagerStub)); |
|
95 | 95 | |
96 | - $orderManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
97 | - ->will( $this->returnValue( array( $orderItem->getId() => $orderItem ) ) ); |
|
96 | + $orderManagerStub->expects($this->once())->method('searchItems') |
|
97 | + ->will($this->returnValue(array($orderItem->getId() => $orderItem))); |
|
98 | 98 | |
99 | - $orderBaseManagerStub->expects( $this->once() )->method( 'deleteItems' ); |
|
99 | + $orderBaseManagerStub->expects($this->once())->method('deleteItems'); |
|
100 | 100 | |
101 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
101 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
102 | 102 | |
103 | 103 | |
104 | - $object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unfinished\Standard( $context, $aimeos ); |
|
104 | + $object = new \Aimeos\Controller\Jobs\Order\Cleanup\Unfinished\Standard($context, $aimeos); |
|
105 | 105 | $object->run(); |
106 | 106 | } |
107 | 107 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $context = \TestHelperJobs::getContext(); |
25 | 25 | $aimeos = \TestHelperJobs::getAimeos(); |
26 | 26 | |
27 | - $this->object = new \Aimeos\Controller\Jobs\Admin\Cache\Standard( $context, $aimeos ); |
|
27 | + $this->object = new \Aimeos\Controller\Jobs\Admin\Cache\Standard($context, $aimeos); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testGetName() |
44 | 44 | { |
45 | - $this->assertEquals( 'Cache cleanup', $this->object->getName() ); |
|
45 | + $this->assertEquals('Cache cleanup', $this->object->getName()); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetDescription() |
50 | 50 | { |
51 | 51 | $text = 'Removes the expired entries from the cache'; |
52 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
52 | + $this->assertEquals($text, $this->object->getDescription()); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 |