@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | { |
13 | 13 | protected function setUp() |
14 | 14 | { |
15 | - \Aimeos\MShop\Factory::setCache( true ); |
|
15 | + \Aimeos\MShop\Factory::setCache(true); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | protected function tearDown() |
20 | 20 | { |
21 | - \Aimeos\MShop\Factory::setCache( false ); |
|
21 | + \Aimeos\MShop\Factory::setCache(false); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -26,29 +26,29 @@ discard block |
||
26 | 26 | { |
27 | 27 | $context = \TestHelperCntl::getContext(); |
28 | 28 | |
29 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
29 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
30 | 30 | |
31 | - $fcn = function( $subject ){ |
|
31 | + $fcn = function($subject) { |
|
32 | 32 | return $subject->getGroups() === ['1', '2']; |
33 | 33 | }; |
34 | 34 | |
35 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
36 | - ->setConstructorArgs( [$context] ) |
|
37 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
35 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
36 | + ->setConstructorArgs([$context]) |
|
37 | + ->setMethods(['getItem', 'saveItem']) |
|
38 | 38 | ->getMock(); |
39 | 39 | |
40 | - \Aimeos\MShop\Factory::injectManager( $context, 'customer', $customerStub ); |
|
40 | + \Aimeos\MShop\Factory::injectManager($context, 'customer', $customerStub); |
|
41 | 41 | |
42 | 42 | $customerItem = $customerStub->createItem(); |
43 | 43 | |
44 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
45 | - ->will( $this->returnValue( $customerItem ) ); |
|
44 | + $customerStub->expects($this->once())->method('getItem') |
|
45 | + ->will($this->returnValue($customerItem)); |
|
46 | 46 | |
47 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
48 | - ->with( $this->callback( $fcn ) ); |
|
47 | + $customerStub->expects($this->once())->method('saveItem') |
|
48 | + ->with($this->callback($fcn)); |
|
49 | 49 | |
50 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
51 | - $object->begin( $this->getSubscription( $context ) ); |
|
50 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
51 | + $object->begin($this->getSubscription($context)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -56,45 +56,45 @@ discard block |
||
56 | 56 | { |
57 | 57 | $context = \TestHelperCntl::getContext(); |
58 | 58 | |
59 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
59 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
60 | 60 | |
61 | - $fcn = function( $subject ){ |
|
61 | + $fcn = function($subject) { |
|
62 | 62 | return $subject->getGroups() === []; |
63 | 63 | }; |
64 | 64 | |
65 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
66 | - ->setConstructorArgs( [$context] ) |
|
67 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
65 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
66 | + ->setConstructorArgs([$context]) |
|
67 | + ->setMethods(['getItem', 'saveItem']) |
|
68 | 68 | ->getMock(); |
69 | 69 | |
70 | - \Aimeos\MShop\Factory::injectManager( $context, 'customer', $customerStub ); |
|
70 | + \Aimeos\MShop\Factory::injectManager($context, 'customer', $customerStub); |
|
71 | 71 | |
72 | - $customerItem = $customerStub->createItem()->setGroups( ['1', '2'] ); |
|
72 | + $customerItem = $customerStub->createItem()->setGroups(['1', '2']); |
|
73 | 73 | |
74 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
75 | - ->will( $this->returnValue( $customerItem ) ); |
|
74 | + $customerStub->expects($this->once())->method('getItem') |
|
75 | + ->will($this->returnValue($customerItem)); |
|
76 | 76 | |
77 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
78 | - ->with( $this->callback( $fcn ) ); |
|
77 | + $customerStub->expects($this->once())->method('saveItem') |
|
78 | + ->with($this->callback($fcn)); |
|
79 | 79 | |
80 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
81 | - $object->end( $this->getSubscription( $context ) ); |
|
80 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
81 | + $object->end($this->getSubscription($context)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | - protected function getSubscription( $context ) |
|
85 | + protected function getSubscription($context) |
|
86 | 86 | { |
87 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
87 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
88 | 88 | |
89 | 89 | $search = $manager->createSearch(); |
90 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
90 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
91 | 91 | |
92 | - $items = $manager->searchItems( $search ); |
|
92 | + $items = $manager->searchItems($search); |
|
93 | 93 | |
94 | - if( ( $item = reset( $items ) ) !== false ) { |
|
94 | + if (($item = reset($items)) !== false) { |
|
95 | 95 | return $item; |
96 | 96 | } |
97 | 97 | |
98 | - throw new \Exception( 'No subscription item found' ); |
|
98 | + throw new \Exception('No subscription item found'); |
|
99 | 99 | } |
100 | 100 | } |