Completed
Push — master ( 0229de...f71bfb )
by Aimeos
04:41
created
admin/jqadm/tests/Admin/JQAdm/Product/Physical/StandardTest.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -21,64 +21,64 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Physical\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Physical\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-physical', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-physical', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC', ['product/property'] );
53
+		$this->view->item = $manager->findItem('CNC', ['product/property']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'value="20.0"', $result );
58
-		$this->assertContains( 'value="15.0"', $result );
59
-		$this->assertContains( 'value="10.0"', $result );
60
-		$this->assertContains( 'value="1.25"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('value="20.0"', $result);
58
+		$this->assertContains('value="15.0"', $result);
59
+		$this->assertContains('value="10.0"', $result);
60
+		$this->assertContains('value="1.25"', $result);
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testGet()
65 65
 	{
66
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
66
+		$manager = \Aimeos\MShop::create($this->context, 'product');
67 67
 
68
-		$this->view->item = $manager->findItem( 'CNC', ['product/property'] );
68
+		$this->view->item = $manager->findItem('CNC', ['product/property']);
69 69
 		$result = $this->object->get();
70 70
 
71
-		$this->assertNull( $this->view->get( 'errors' ) );
72
-		$this->assertContains( 'value="20.0"', $result );
73
-		$this->assertContains( 'value="15.0"', $result );
74
-		$this->assertContains( 'value="10.0"', $result );
75
-		$this->assertContains( 'value="1.25"', $result );
71
+		$this->assertNull($this->view->get('errors'));
72
+		$this->assertContains('value="20.0"', $result);
73
+		$this->assertContains('value="15.0"', $result);
74
+		$this->assertContains('value="10.0"', $result);
75
+		$this->assertContains('value="1.25"', $result);
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testSave()
80 80
 	{
81
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
81
+		$manager = \Aimeos\MShop::create($this->context, 'product');
82 82
 		$this->view->item = $manager->createItem();
83 83
 
84 84
 		$param = array(
@@ -89,60 +89,60 @@  discard block
 block discarded – undo
89 89
 			),
90 90
 		);
91 91
 
92
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
93
-		$this->view->addHelper( 'param', $helper );
92
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
93
+		$this->view->addHelper('param', $helper);
94 94
 
95 95
 		$result = $this->object->save();
96 96
 
97
-		$this->assertNull( $this->view->get( 'errors' ) );
98
-		$this->assertNull( $result );
99
-		$this->assertEquals( 2, count( $this->view->item->getPropertyItems() ) );
97
+		$this->assertNull($this->view->get('errors'));
98
+		$this->assertNull($result);
99
+		$this->assertEquals(2, count($this->view->item->getPropertyItems()));
100 100
 	}
101 101
 
102 102
 
103 103
 	public function testSaveException()
104 104
 	{
105
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Physical\Standard::class )
106
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
107
-			->setMethods( array( 'fromArray' ) )
105
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Physical\Standard::class)
106
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
107
+			->setMethods(array('fromArray'))
108 108
 			->getMock();
109 109
 
110
-		$object->expects( $this->once() )->method( 'fromArray' )
111
-			->will( $this->throwException( new \RuntimeException() ) );
110
+		$object->expects($this->once())->method('fromArray')
111
+			->will($this->throwException(new \RuntimeException()));
112 112
 
113 113
 		$this->view = \TestHelperJqadm::getView();
114
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
114
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
115 115
 
116
-		$object->setView( $this->view );
116
+		$object->setView($this->view);
117 117
 
118
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
118
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
119 119
 		$object->save();
120 120
 	}
121 121
 
122 122
 
123 123
 	public function testSaveMShopException()
124 124
 	{
125
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Physical\Standard::class )
126
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
127
-			->setMethods( array( 'fromArray' ) )
125
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Physical\Standard::class)
126
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
127
+			->setMethods(array('fromArray'))
128 128
 			->getMock();
129 129
 
130
-		$object->expects( $this->once() )->method( 'fromArray' )
131
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
130
+		$object->expects($this->once())->method('fromArray')
131
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
132 132
 
133 133
 		$this->view = \TestHelperJqadm::getView();
134
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
134
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
135 135
 
136
-		$object->setView( $this->view );
136
+		$object->setView($this->view);
137 137
 
138
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
138
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
139 139
 		$object->save();
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testGetSubClient()
144 144
 	{
145
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
146
-		$this->object->getSubClient( 'unknown' );
145
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
146
+		$this->object->getSubClient('unknown');
147 147
 	}
148 148
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Price/StandardTest.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Price\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Price\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-price', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-price', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC', array( 'price' ) );
53
+		$this->view->item = $manager->findItem('CNC', array('price'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"price.type":"default"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"price.type":"default"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'product');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'product');
76 76
 
77
-		$this->view->item = $manager->findItem( 'CNC', array( 'price' ) );
77
+		$this->view->item = $manager->findItem('CNC', array('price'));
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '"price.type":"default"', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('"price.type":"default"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'product');
88 88
 		$item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -102,80 +102,80 @@  discard block
 block discarded – undo
102 102
 			]],
103 103
 		);
104 104
 
105
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
106
-		$this->view->addHelper( 'param', $helper );
105
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
106
+		$this->view->addHelper('param', $helper);
107 107
 		$this->view->item = $item;
108 108
 
109 109
 		$result = $this->object->save();
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems() ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems()));
114 114
 
115
-		foreach( $item->getListItems( 'price' ) as $listItem )
115
+		foreach ($item->getListItems('price') as $listItem)
116 116
 		{
117
-			$this->assertEquals( 'price', $listItem->getDomain() );
117
+			$this->assertEquals('price', $listItem->getDomain());
118 118
 
119 119
 			$refItem = $listItem->getRefItem();
120
-			$this->assertEquals( 'EUR', $refItem->getCurrencyId() );
121
-			$this->assertEquals( '2', $refItem->getQuantity() );
122
-			$this->assertEquals( '10.00', $refItem->getValue() );
123
-			$this->assertEquals( '1.00', $refItem->getCosts() );
124
-			$this->assertEquals( '5.00', $refItem->getRebate() );
125
-			$this->assertEquals( '20.00', $refItem->getTaxRate() );
120
+			$this->assertEquals('EUR', $refItem->getCurrencyId());
121
+			$this->assertEquals('2', $refItem->getQuantity());
122
+			$this->assertEquals('10.00', $refItem->getValue());
123
+			$this->assertEquals('1.00', $refItem->getCosts());
124
+			$this->assertEquals('5.00', $refItem->getRebate());
125
+			$this->assertEquals('20.00', $refItem->getTaxRate());
126 126
 		}
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testSaveException()
131 131
 	{
132
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Price\Standard::class )
133
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
134
-			->setMethods( array( 'fromArray' ) )
132
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Price\Standard::class)
133
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
134
+			->setMethods(array('fromArray'))
135 135
 			->getMock();
136 136
 
137
-		$object->expects( $this->once() )->method( 'fromArray' )
138
-			->will( $this->throwException( new \RuntimeException() ) );
137
+		$object->expects($this->once())->method('fromArray')
138
+			->will($this->throwException(new \RuntimeException()));
139 139
 
140 140
 		$view = \TestHelperJqadm::getView();
141
-		$view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
141
+		$view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
142 142
 
143
-		$object->setView( $view );
143
+		$object->setView($view);
144 144
 
145
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
145
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
146 146
 		$object->save();
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testSaveMShopException()
151 151
 	{
152
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Price\Standard::class )
153
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
154
-			->setMethods( array( 'fromArray' ) )
152
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Price\Standard::class)
153
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
154
+			->setMethods(array('fromArray'))
155 155
 			->getMock();
156 156
 
157
-		$object->expects( $this->once() )->method( 'fromArray' )
158
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
157
+		$object->expects($this->once())->method('fromArray')
158
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
159 159
 
160 160
 		$this->view = \TestHelperJqadm::getView();
161
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
161
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
162 162
 
163
-		$object->setView( $this->view );
163
+		$object->setView($this->view);
164 164
 
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->save();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSearch()
171 171
 	{
172
-		$this->assertNull( $this->object->search() );
172
+		$this->assertNull($this->object->search());
173 173
 	}
174 174
 
175 175
 
176 176
 	public function testGetSubClient()
177 177
 	{
178
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
179
-		$this->object->getSubClient( 'unknown' );
178
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
179
+		$this->object->getSubClient('unknown');
180 180
 	}
181 181
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Property/StandardTest.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Attribute\Property\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Attribute\Property\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Properties', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
52 52
 
53
-		$this->view->item = $manager->findItem( 'black', [], 'product', 'color' );
53
+		$this->view->item = $manager->findItem('black', [], 'product', 'color');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Properties', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Properties', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,26 +62,26 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
73 73
 
74
-		$this->view->item = $manager->findItem( 'black', [], 'product', 'color' );
74
+		$this->view->item = $manager->findItem('black', [], 'product', 'color');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Properties', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Properties', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -95,70 +95,70 @@  discard block
 block discarded – undo
95 95
 			),
96 96
 		);
97 97
 
98
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
99
-		$this->view->addHelper( 'param', $helper );
98
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
99
+		$this->view->addHelper('param', $helper);
100 100
 
101 101
 		$result = $this->object->save();
102 102
 
103
-		$items = $this->view->item->getPropertyItems( null, false );
103
+		$items = $this->view->item->getPropertyItems(null, false);
104 104
 
105
-		$this->assertNull( $this->view->get( 'errors' ) );
106
-		$this->assertNull( $result );
107
-		$this->assertEquals( 1, count( $items ) );
108
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
109
-		$this->assertEquals( '#100000', reset( $items )->getValue() );
105
+		$this->assertNull($this->view->get('errors'));
106
+		$this->assertNull($result);
107
+		$this->assertEquals(1, count($items));
108
+		$this->assertEquals(null, reset($items)->getLanguageId());
109
+		$this->assertEquals('#100000', reset($items)->getValue());
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testSaveException()
114 114
 	{
115
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Property\Standard::class )
116
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
117
-			->setMethods( array( 'fromArray' ) )
115
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Property\Standard::class)
116
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
117
+			->setMethods(array('fromArray'))
118 118
 			->getMock();
119 119
 
120
-		$object->expects( $this->once() )->method( 'fromArray' )
121
-			->will( $this->throwException( new \RuntimeException() ) );
120
+		$object->expects($this->once())->method('fromArray')
121
+			->will($this->throwException(new \RuntimeException()));
122 122
 
123 123
 		$this->view = \TestHelperJqadm::getView();
124
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
124
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
125 125
 
126
-		$object->setView( $this->view );
126
+		$object->setView($this->view);
127 127
 
128
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
128
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
129 129
 		$object->save();
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testSaveMShopException()
134 134
 	{
135
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Property\Standard::class )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'fromArray' ) )
135
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Property\Standard::class)
136
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
137
+			->setMethods(array('fromArray'))
138 138
 			->getMock();
139 139
 
140
-		$object->expects( $this->once() )->method( 'fromArray' )
141
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
140
+		$object->expects($this->once())->method('fromArray')
141
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
142 142
 
143 143
 		$this->view = \TestHelperJqadm::getView();
144
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
144
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
145 145
 
146
-		$object->setView( $this->view );
146
+		$object->setView($this->view);
147 147
 
148
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
148
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
149 149
 		$object->save();
150 150
 	}
151 151
 
152 152
 
153 153
 	public function testSearch()
154 154
 	{
155
-		$this->assertNull( $this->object->search() );
155
+		$this->assertNull($this->object->search());
156 156
 	}
157 157
 
158 158
 
159 159
 	public function testGetSubClient()
160 160
 	{
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
162
-		$this->object->getSubClient( 'unknown' );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162
+		$this->object->getSubClient('unknown');
163 163
 	}
164 164
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/CacheTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,62 +19,62 @@
 block discarded – undo
19 19
 
20 20
 	protected function setUp()
21 21
 	{
22
-		$this->cache = $this->getMockBuilder( 'Aimeos\MW\Cache\None' )
23
-			->setMethods( array( 'deleteByTags' ) )
22
+		$this->cache = $this->getMockBuilder('Aimeos\MW\Cache\None')
23
+			->setMethods(array('deleteByTags'))
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' )
28
-			->setMethods( array( 'delete', 'save' ) )
27
+		$this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard')
28
+			->setMethods(array('delete', 'save'))
29 29
 			->disableOriginalConstructor()
30 30
 			->getMock();
31 31
 
32 32
 		$this->context = \TestHelperJqadm::getContext();
33
-		$this->context->setCache( $this->cache );
33
+		$this->context->setCache($this->cache);
34 34
 
35
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache( $this->mock, $this->context );
36
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
37
-		$this->object->setView( \TestHelperJqadm::getView() );
35
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache($this->mock, $this->context);
36
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
37
+		$this->object->setView(\TestHelperJqadm::getView());
38 38
 	}
39 39
 
40 40
 
41 41
 	protected function tearDown()
42 42
 	{
43
-		unset( $this->object, $this->mock, $this->context, $this->cache );
43
+		unset($this->object, $this->mock, $this->context, $this->cache);
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testDelete()
48 48
 	{
49 49
 		$view = \TestHelperJqadm::getView();
50
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => 1 ) );
51
-		$view->addHelper( 'param', $helper );
50
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => 1));
51
+		$view->addHelper('param', $helper);
52 52
 
53
-		$tags = array( 'product', 'product-1' );
54
-		$this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) );
55
-		$this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) );
53
+		$tags = array('product', 'product-1');
54
+		$this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags));
55
+		$this->mock->expects($this->once())->method('delete')->will($this->returnValue('test'));
56 56
 
57
-		$this->object->setView( $view );
57
+		$this->object->setView($view);
58 58
 		$result = $this->object->delete();
59 59
 
60
-		$this->assertEquals( 'test', $result );
60
+		$this->assertEquals('test', $result);
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testSave()
65 65
 	{
66
-		$item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'CNC' );
66
+		$item = \Aimeos\MShop::create($this->context, 'product')->findItem('CNC');
67 67
 
68
-		$tags = array( 'product', 'product-' . $item->getId() );
68
+		$tags = array('product', 'product-' . $item->getId());
69 69
 		$view = \TestHelperJqadm::getView();
70 70
 		$view->item = $item;
71 71
 
72
-		$this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) );
73
-		$this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) );
72
+		$this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags));
73
+		$this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
74 74
 
75
-		$this->object->setView( $view );
75
+		$this->object->setView($view);
76 76
 		$result = $this->object->save();
77 77
 
78
-		$this->assertEquals( 'test', $result );
78
+		$this->assertEquals('test', $result);
79 79
 	}
80 80
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/IndexTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,48 +20,48 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperJqadm::getContext();
22 22
 
23
-		$this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' )
24
-			->setMethods( array( 'delete', 'save' ) )
23
+		$this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard')
24
+			->setMethods(array('delete', 'save'))
25 25
 			->disableOriginalConstructor()
26 26
 			->getMock();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index( $this->mock, $this->context );
29
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
30
-		$this->object->setView( \TestHelperJqadm::getView() );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index($this->mock, $this->context);
29
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
30
+		$this->object->setView(\TestHelperJqadm::getView());
31 31
 	}
32 32
 
33 33
 
34 34
 	protected function tearDown()
35 35
 	{
36
-		unset( $this->object, $this->mock, $this->context );
36
+		unset($this->object, $this->mock, $this->context);
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testDelete()
41 41
 	{
42 42
 		$view = \TestHelperJqadm::getView();
43
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => -1 ) );
44
-		$view->addHelper( 'param', $helper );
43
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => -1));
44
+		$view->addHelper('param', $helper);
45 45
 
46
-		$this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) );
47
-		$this->object->setView( $view );
46
+		$this->mock->expects($this->once())->method('delete')->will($this->returnValue('test'));
47
+		$this->object->setView($view);
48 48
 
49 49
 		$result = $this->object->delete();
50 50
 
51
-		$this->assertEquals( 'test', $result );
51
+		$this->assertEquals('test', $result);
52 52
 	}
53 53
 
54 54
 
55 55
 	public function testSave()
56 56
 	{
57 57
 		$view = \TestHelperJqadm::getView();
58
-		$view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'CNC' );
58
+		$view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('CNC');
59 59
 
60
-		$this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) );
61
-		$this->object->setView( $view );
60
+		$this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
61
+		$this->object->setView($view);
62 62
 
63 63
 		$result = $this->object->save();
64 64
 
65
-		$this->assertEquals( 'test', $result );
65
+		$this->assertEquals('test', $result);
66 66
 	}
67 67
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/Site/StandardTest.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -21,34 +21,34 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $this->view, ['super'] );
25
-		$this->view->addHelper( 'access', $helper );
24
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($this->view, ['super']);
25
+		$this->view->addHelper('access', $helper);
26 26
 
27
-		$this->object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard( $this->context );
28
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
29
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
30
-		$this->object->setView( $this->view );
27
+		$this->object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard($this->context);
28
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
29
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
30
+		$this->object->setView($this->view);
31 31
 	}
32 32
 
33 33
 
34 34
 	protected function tearDown()
35 35
 	{
36
-		unset( $this->object, $this->view, $this->context );
36
+		unset($this->object, $this->view, $this->context);
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreate()
41 41
 	{
42
-		$this->assertContains( 'item-locale-site', $this->object->create() );
42
+		$this->assertContains('item-locale-site', $this->object->create());
43 43
 	}
44 44
 
45 45
 
46 46
 	public function testCreateException()
47 47
 	{
48
-		$object = $this->getClientMock( 'getSubClients' );
48
+		$object = $this->getClientMock('getSubClients');
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53 53
 		$object->create();
54 54
 	}
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function testCreateMShopException()
58 58
 	{
59
-		$object = $this->getClientMock( 'getSubClients' );
59
+		$object = $this->getClientMock('getSubClients');
60 60
 
61
-		$object->expects( $this->once() )->method( 'getSubClients' )
62
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
61
+		$object->expects($this->once())->method('getSubClients')
62
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
63 63
 
64 64
 		$object->create();
65 65
 	}
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
 
68 68
 	public function testCopy()
69 69
 	{
70
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
70
+		$manager = \Aimeos\MShop::create($this->context, 'locale/site');
71 71
 
72
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
73
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
74
-		$this->view->addHelper( 'param', $helper );
72
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
73
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
74
+		$this->view->addHelper('param', $helper);
75 75
 
76 76
 		$result = $this->object->copy();
77 77
 
78
-		$this->assertContains( 'unittest', $result );
78
+		$this->assertContains('unittest', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testCopyException()
83 83
 	{
84
-		$object = $this->getClientMock( 'getSubClients' );
84
+		$object = $this->getClientMock('getSubClients');
85 85
 
86
-		$object->expects( $this->once() )->method( 'getSubClients' )
87
-			->will( $this->throwException( new \RuntimeException() ) );
86
+		$object->expects($this->once())->method('getSubClients')
87
+			->will($this->throwException(new \RuntimeException()));
88 88
 
89 89
 		$object->copy();
90 90
 	}
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 
93 93
 	public function testCopyMShopException()
94 94
 	{
95
-		$object = $this->getClientMock( 'getSubClients' );
95
+		$object = $this->getClientMock('getSubClients');
96 96
 
97
-		$object->expects( $this->once() )->method( 'getSubClients' )
98
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
97
+		$object->expects($this->once())->method('getSubClients')
98
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
99 99
 
100 100
 		$object->copy();
101 101
 	}
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 
104 104
 	public function testDelete()
105 105
 	{
106
-		$this->assertNotNull( $this->object->delete() );
106
+		$this->assertNotNull($this->object->delete());
107 107
 	}
108 108
 
109 109
 
110 110
 	public function testDeleteException()
111 111
 	{
112
-		$object = $this->getClientMock( 'getSubClients' );
112
+		$object = $this->getClientMock('getSubClients');
113 113
 
114
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
115
-			->will( $this->throwException( new \RuntimeException() ) );
114
+		$object->expects($this->exactly(2))->method('getSubClients')
115
+			->will($this->throwException(new \RuntimeException()));
116 116
 
117 117
 		$object->delete();
118 118
 	}
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDeleteMShopException()
122 122
 	{
123
-		$object = $this->getClientMock( 'getSubClients' );
123
+		$object = $this->getClientMock('getSubClients');
124 124
 
125
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
126
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
125
+		$object->expects($this->exactly(2))->method('getSubClients')
126
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
127 127
 
128 128
 		$object->delete();
129 129
 	}
@@ -131,24 +131,24 @@  discard block
 block discarded – undo
131 131
 
132 132
 	public function testGet()
133 133
 	{
134
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
134
+		$manager = \Aimeos\MShop::create($this->context, 'locale/site');
135 135
 
136
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
137
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
138
-		$this->view->addHelper( 'param', $helper );
136
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
137
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
138
+		$this->view->addHelper('param', $helper);
139 139
 
140 140
 		$result = $this->object->get();
141 141
 
142
-		$this->assertContains( 'unittest', $result );
142
+		$this->assertContains('unittest', $result);
143 143
 	}
144 144
 
145 145
 
146 146
 	public function testGetException()
147 147
 	{
148
-		$object = $this->getClientMock( 'getSubClients' );
148
+		$object = $this->getClientMock('getSubClients');
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \RuntimeException() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \RuntimeException()));
152 152
 
153 153
 		$object->get();
154 154
 	}
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
 
157 157
 	public function testGetMShopException()
158 158
 	{
159
-		$object = $this->getClientMock( 'getSubClients' );
159
+		$object = $this->getClientMock('getSubClients');
160 160
 
161
-		$object->expects( $this->once() )->method( 'getSubClients' )
162
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
161
+		$object->expects($this->once())->method('getSubClients')
162
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
163 163
 
164 164
 		$object->get();
165 165
 	}
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
 
168 168
 	public function testGetViewException()
169 169
 	{
170
-		$object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard( $this->context, [] );
170
+		$object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard($this->context, []);
171 171
 
172
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
172
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
173 173
 		$object->getView();
174 174
 	}
175 175
 
176 176
 
177 177
 	public function testSave()
178 178
 	{
179
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
179
+		$manager = \Aimeos\MShop::create($this->context, 'locale/site');
180 180
 
181 181
 		$param = array(
182 182
 			'site' => 'unittest',
@@ -192,24 +192,24 @@  discard block
 block discarded – undo
192 192
 			),
193 193
 		);
194 194
 
195
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
196
-		$this->view->addHelper( 'param', $helper );
195
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
196
+		$this->view->addHelper('param', $helper);
197 197
 
198 198
 		$this->object->save();
199 199
 
200
-		$item = $manager->findItem( 'jqadm@test' );
201
-		$manager->deleteItem( $item->getId() );
200
+		$item = $manager->findItem('jqadm@test');
201
+		$manager->deleteItem($item->getId());
202 202
 
203
-		$this->assertEquals( ['test' => 'value'], $item->getConfig() );
203
+		$this->assertEquals(['test' => 'value'], $item->getConfig());
204 204
 	}
205 205
 
206 206
 
207 207
 	public function testSaveException()
208 208
 	{
209
-		$object = $this->getClientMock( 'fromArray' );
209
+		$object = $this->getClientMock('fromArray');
210 210
 
211
-		$object->expects( $this->once() )->method( 'fromArray' )
212
-			->will( $this->throwException( new \RuntimeException() ) );
211
+		$object->expects($this->once())->method('fromArray')
212
+			->will($this->throwException(new \RuntimeException()));
213 213
 
214 214
 		$object->save();
215 215
 	}
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 
218 218
 	public function testSaveMShopException()
219 219
 	{
220
-		$object = $this->getClientMock( 'fromArray' );
220
+		$object = $this->getClientMock('fromArray');
221 221
 
222
-		$object->expects( $this->once() )->method( 'fromArray' )
223
-			->will( $this->throwException( new \RuntimeException() ) );
222
+		$object->expects($this->once())->method('fromArray')
223
+			->will($this->throwException(new \RuntimeException()));
224 224
 
225 225
 		$object->save();
226 226
 	}
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
 
229 229
 	public function testSaveJQAdmException()
230 230
 	{
231
-		$object = $this->getClientMock( 'fromArray' );
231
+		$object = $this->getClientMock('fromArray');
232 232
 
233
-		$object->expects( $this->once() )->method( 'fromArray' )
234
-			->will( $this->throwException( new \RuntimeException() ) );
233
+		$object->expects($this->once())->method('fromArray')
234
+			->will($this->throwException(new \RuntimeException()));
235 235
 
236 236
 		$object->save();
237 237
 	}
@@ -242,27 +242,27 @@  discard block
 block discarded – undo
242 242
 		$param = array(
243 243
 			'site' => 'unittest', 'lang' => 'de',
244 244
 			'filter' => array(
245
-				'key' => array( 0 => 'locale.site.code' ),
246
-				'op' => array( 0 => '==' ),
247
-				'val' => array( 0 => 'unittest' ),
245
+				'key' => array(0 => 'locale.site.code'),
246
+				'op' => array(0 => '=='),
247
+				'val' => array(0 => 'unittest'),
248 248
 			),
249
-			'sort' => array( '-locale.site.id' ),
249
+			'sort' => array('-locale.site.id'),
250 250
 		);
251
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
252
-		$this->view->addHelper( 'param', $helper );
251
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
252
+		$this->view->addHelper('param', $helper);
253 253
 
254 254
 		$result = $this->object->search();
255 255
 
256
-		$this->assertContains( '>unittest<', $result );
256
+		$this->assertContains('>unittest<', $result);
257 257
 	}
258 258
 
259 259
 
260 260
 	public function testSearchException()
261 261
 	{
262
-		$object = $this->getClientMock( 'initCriteria' );
262
+		$object = $this->getClientMock('initCriteria');
263 263
 
264
-		$object->expects( $this->once() )->method( 'initCriteria' )
265
-			->will( $this->throwException( new \RuntimeException() ) );
264
+		$object->expects($this->once())->method('initCriteria')
265
+			->will($this->throwException(new \RuntimeException()));
266 266
 
267 267
 		$object->search();
268 268
 	}
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 
271 271
 	public function testSearchMShopException()
272 272
 	{
273
-		$object = $this->getClientMock( 'initCriteria' );
273
+		$object = $this->getClientMock('initCriteria');
274 274
 
275
-		$object->expects( $this->once() )->method( 'initCriteria' )
276
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
275
+		$object->expects($this->once())->method('initCriteria')
276
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
277 277
 
278 278
 		$object->search();
279 279
 	}
@@ -281,27 +281,27 @@  discard block
 block discarded – undo
281 281
 
282 282
 	public function testGetSubClientInvalid()
283 283
 	{
284
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
285
-		$this->object->getSubClient( '$unknown$' );
284
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
285
+		$this->object->getSubClient('$unknown$');
286 286
 	}
287 287
 
288 288
 
289 289
 	public function testGetSubClientUnknown()
290 290
 	{
291
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
292
-		$this->object->getSubClient( 'unknown' );
291
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
292
+		$this->object->getSubClient('unknown');
293 293
 	}
294 294
 
295 295
 
296
-	public function getClientMock( $method )
296
+	public function getClientMock($method)
297 297
 	{
298
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Site\Standard::class )
299
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
300
-			->setMethods( [$method] )
298
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Site\Standard::class)
299
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
300
+			->setMethods([$method])
301 301
 			->getMock();
302 302
 
303
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
304
-		$object->setView( $this->getViewNoRender() );
303
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
304
+		$object->setView($this->getViewNoRender());
305 305
 
306 306
 		return $object;
307 307
 	}
@@ -309,19 +309,19 @@  discard block
 block discarded – undo
309 309
 
310 310
 	protected function getViewNoRender()
311 311
 	{
312
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
313
-			->setConstructorArgs( array( [] ) )
314
-			->setMethods( array( 'render', 'config' ) )
312
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
313
+			->setConstructorArgs(array([]))
314
+			->setMethods(array('render', 'config'))
315 315
 			->getMock();
316 316
 
317
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
317
+		$manager = \Aimeos\MShop::create($this->context, 'locale/site');
318 318
 
319
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
320
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
321
-		$view->addHelper( 'param', $helper );
319
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
320
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
321
+		$view->addHelper('param', $helper);
322 322
 
323
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $this->view, ['super'] );
324
-		$view->addHelper( 'access', $helper );
323
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($this->view, ['super']);
324
+		$view->addHelper('access', $helper);
325 325
 
326 326
 		return $view;
327 327
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/Currency/StandardTest.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getClientMock( 'getSubClients' );
45
+		$object = $this->getClientMock('getSubClients');
46 46
 
47
-		$object->expects( $this->once() )->method( 'getSubClients' )
48
-			->will( $this->throwException( new \RuntimeException() ) );
47
+		$object->expects($this->once())->method('getSubClients')
48
+			->will($this->throwException(new \RuntimeException()));
49 49
 
50 50
 		$object->create();
51 51
 	}
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	public function testCreateMShopException()
55 55
 	{
56
-		$object = $this->getClientMock( 'getSubClients' );
56
+		$object = $this->getClientMock('getSubClients');
57 57
 
58
-		$object->expects( $this->once() )->method( 'getSubClients' )
59
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
58
+		$object->expects($this->once())->method('getSubClients')
59
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
60 60
 
61 61
 		$object->create();
62 62
 	}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70 70
 		$result = $this->object->copy();
71 71
 
72
-		$this->assertContains( 'Euro', $result );
72
+		$this->assertContains('Euro', $result);
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testCopyException()
77 77
 	{
78
-		$object = $this->getClientMock( 'getSubClients' );
78
+		$object = $this->getClientMock('getSubClients');
79 79
 
80
-		$object->expects( $this->once() )->method( 'getSubClients' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('getSubClients')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83 83
 		$object->copy();
84 84
 	}
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function testCopyMShopException()
88 88
 	{
89
-		$object = $this->getClientMock( 'getSubClients' );
89
+		$object = $this->getClientMock('getSubClients');
90 90
 
91
-		$object->expects( $this->once() )->method( 'getSubClients' )
92
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
91
+		$object->expects($this->once())->method('getSubClients')
92
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
93 93
 
94 94
 		$object->copy();
95 95
 	}
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 
98 98
 	public function testDelete()
99 99
 	{
100
-		$this->assertNotNull( $this->object->delete() );
100
+		$this->assertNotNull($this->object->delete());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testDeleteException()
105 105
 	{
106
-		$object = $this->getClientMock( 'getSubClients' );
106
+		$object = $this->getClientMock('getSubClients');
107 107
 
108
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->exactly(2))->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$object->delete();
112 112
 	}
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
 	public function testDeleteMShopException()
116 116
 	{
117
-		$object = $this->getClientMock( 'getSubClients' );
117
+		$object = $this->getClientMock('getSubClients');
118 118
 
119
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
120
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
119
+		$object->expects($this->exactly(2))->method('getSubClients')
120
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
121 121
 
122 122
 		$object->delete();
123 123
 	}
@@ -125,21 +125,21 @@  discard block
 block discarded – undo
125 125
 
126 126
 	public function testGet()
127 127
 	{
128
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
129
-		$this->view->addHelper( 'param', $helper );
128
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
129
+		$this->view->addHelper('param', $helper);
130 130
 
131 131
 		$result = $this->object->get();
132 132
 
133
-		$this->assertContains( 'EUR', $result );
133
+		$this->assertContains('EUR', $result);
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testGetException()
138 138
 	{
139
-		$object = $this->getClientMock( 'getSubClients' );
139
+		$object = $this->getClientMock('getSubClients');
140 140
 
141
-		$object->expects( $this->once() )->method( 'getSubClients' )
142
-			->will( $this->throwException( new \RuntimeException() ) );
141
+		$object->expects($this->once())->method('getSubClients')
142
+			->will($this->throwException(new \RuntimeException()));
143 143
 
144 144
 		$object->get();
145 145
 	}
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 
148 148
 	public function testGetMShopException()
149 149
 	{
150
-		$object = $this->getClientMock( 'getSubClients' );
150
+		$object = $this->getClientMock('getSubClients');
151 151
 
152
-		$object->expects( $this->once() )->method( 'getSubClients' )
153
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
152
+		$object->expects($this->once())->method('getSubClients')
153
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
154 154
 
155 155
 		$object->get();
156 156
 	}
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGetViewException()
160 160
 	{
161
-		$object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard( $this->context, [] );
161
+		$object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard($this->context, []);
162 162
 
163
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
163
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/currency' );
170
+		$manager = \Aimeos\MShop::create($this->context, 'locale/currency');
171 171
 
172 172
 		$param = array(
173 173
 			'item' => array(
@@ -178,24 +178,24 @@  discard block
 block discarded – undo
178 178
 			),
179 179
 		);
180 180
 
181
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
182
-		$this->view->addHelper( 'param', $helper );
181
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
182
+		$this->view->addHelper('param', $helper);
183 183
 
184 184
 		$this->object->save();
185 185
 
186
-		$item = $manager->findItem( 'XXX' );
187
-		$manager->deleteItem( $item->getId() );
186
+		$item = $manager->findItem('XXX');
187
+		$manager->deleteItem($item->getId());
188 188
 
189
-		$this->assertEquals( 'jqadm test', $item->getLabel() );
189
+		$this->assertEquals('jqadm test', $item->getLabel());
190 190
 	}
191 191
 
192 192
 
193 193
 	public function testSaveException()
194 194
 	{
195
-		$object = $this->getClientMock( 'fromArray' );
195
+		$object = $this->getClientMock('fromArray');
196 196
 
197
-		$object->expects( $this->once() )->method( 'fromArray' )
198
-			->will( $this->throwException( new \RuntimeException() ) );
197
+		$object->expects($this->once())->method('fromArray')
198
+			->will($this->throwException(new \RuntimeException()));
199 199
 
200 200
 		$object->save();
201 201
 	}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 
204 204
 	public function testSaveMShopException()
205 205
 	{
206
-		$object = $this->getClientMock( 'fromArray' );
206
+		$object = $this->getClientMock('fromArray');
207 207
 
208
-		$object->expects( $this->once() )->method( 'fromArray' )
209
-			->will( $this->throwException( new \RuntimeException() ) );
208
+		$object->expects($this->once())->method('fromArray')
209
+			->will($this->throwException(new \RuntimeException()));
210 210
 
211 211
 		$object->save();
212 212
 	}
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 	public function testSaveJQAdmException()
216 216
 	{
217
-		$object = $this->getClientMock( 'fromArray' );
217
+		$object = $this->getClientMock('fromArray');
218 218
 
219
-		$object->expects( $this->once() )->method( 'fromArray' )
220
-			->will( $this->throwException( new \RuntimeException() ) );
219
+		$object->expects($this->once())->method('fromArray')
220
+			->will($this->throwException(new \RuntimeException()));
221 221
 
222 222
 		$object->save();
223 223
 	}
@@ -228,27 +228,27 @@  discard block
 block discarded – undo
228 228
 		$param = array(
229 229
 			'lang' => 'de',
230 230
 			'filter' => array(
231
-				'key' => array( 0 => 'locale.currency.code' ),
232
-				'op' => array( 0 => '==' ),
233
-				'val' => array( 0 => 'EUR' ),
231
+				'key' => array(0 => 'locale.currency.code'),
232
+				'op' => array(0 => '=='),
233
+				'val' => array(0 => 'EUR'),
234 234
 			),
235
-			'sort' => array( '-locale.currency.id' ),
235
+			'sort' => array('-locale.currency.id'),
236 236
 		);
237
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
238
-		$this->view->addHelper( 'param', $helper );
237
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
238
+		$this->view->addHelper('param', $helper);
239 239
 
240 240
 		$result = $this->object->search();
241 241
 
242
-		$this->assertContains( '>EUR<', $result );
242
+		$this->assertContains('>EUR<', $result);
243 243
 	}
244 244
 
245 245
 
246 246
 	public function testSearchException()
247 247
 	{
248
-		$object = $this->getClientMock( 'initCriteria' );
248
+		$object = $this->getClientMock('initCriteria');
249 249
 
250
-		$object->expects( $this->once() )->method( 'initCriteria' )
251
-			->will( $this->throwException( new \RuntimeException() ) );
250
+		$object->expects($this->once())->method('initCriteria')
251
+			->will($this->throwException(new \RuntimeException()));
252 252
 
253 253
 		$object->search();
254 254
 	}
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 	public function testSearchMShopException()
258 258
 	{
259
-		$object = $this->getClientMock( 'initCriteria' );
259
+		$object = $this->getClientMock('initCriteria');
260 260
 
261
-		$object->expects( $this->once() )->method( 'initCriteria' )
262
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
261
+		$object->expects($this->once())->method('initCriteria')
262
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
263 263
 
264 264
 		$object->search();
265 265
 	}
@@ -267,27 +267,27 @@  discard block
 block discarded – undo
267 267
 
268 268
 	public function testGetSubClientInvalid()
269 269
 	{
270
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
271
+		$this->object->getSubClient('$unknown$');
272 272
 	}
273 273
 
274 274
 
275 275
 	public function testGetSubClientUnknown()
276 276
 	{
277
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
278
+		$this->object->getSubClient('unknown');
279 279
 	}
280 280
 
281 281
 
282
-	public function getClientMock( $method )
282
+	public function getClientMock($method)
283 283
 	{
284
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Currency\Standard::class )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Currency\Standard::class)
285
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
286
+			->setMethods([$method])
287 287
 			->getMock();
288 288
 
289
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
290
-		$object->setView( $this->getViewNoRender() );
289
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
290
+		$object->setView($this->getViewNoRender());
291 291
 
292 292
 		return $object;
293 293
 	}
@@ -295,16 +295,16 @@  discard block
 block discarded – undo
295 295
 
296 296
 	protected function getViewNoRender()
297 297
 	{
298
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
299
+			->setConstructorArgs(array([]))
300
+			->setMethods(array('render', 'config'))
301 301
 			->getMock();
302 302
 
303
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
304
-		$view->addHelper( 'param', $helper );
303
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
304
+		$view->addHelper('param', $helper);
305 305
 
306
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
307
-		$view->addHelper( 'access', $helper );
306
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
307
+		$view->addHelper('access', $helper);
308 308
 
309 309
 		return $view;
310 310
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/Language/StandardTest.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getClientMock( 'getSubClients' );
45
+		$object = $this->getClientMock('getSubClients');
46 46
 
47
-		$object->expects( $this->once() )->method( 'getSubClients' )
48
-			->will( $this->throwException( new \RuntimeException() ) );
47
+		$object->expects($this->once())->method('getSubClients')
48
+			->will($this->throwException(new \RuntimeException()));
49 49
 
50 50
 		$object->create();
51 51
 	}
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	public function testCreateMShopException()
55 55
 	{
56
-		$object = $this->getClientMock( 'getSubClients' );
56
+		$object = $this->getClientMock('getSubClients');
57 57
 
58
-		$object->expects( $this->once() )->method( 'getSubClients' )
59
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
58
+		$object->expects($this->once())->method('getSubClients')
59
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
60 60
 
61 61
 		$object->create();
62 62
 	}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70 70
 		$result = $this->object->copy();
71 71
 
72
-		$this->assertContains( 'German', $result );
72
+		$this->assertContains('German', $result);
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testCopyException()
77 77
 	{
78
-		$object = $this->getClientMock( 'getSubClients' );
78
+		$object = $this->getClientMock('getSubClients');
79 79
 
80
-		$object->expects( $this->once() )->method( 'getSubClients' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('getSubClients')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83 83
 		$object->copy();
84 84
 	}
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function testCopyMShopException()
88 88
 	{
89
-		$object = $this->getClientMock( 'getSubClients' );
89
+		$object = $this->getClientMock('getSubClients');
90 90
 
91
-		$object->expects( $this->once() )->method( 'getSubClients' )
92
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
91
+		$object->expects($this->once())->method('getSubClients')
92
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
93 93
 
94 94
 		$object->copy();
95 95
 	}
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 
98 98
 	public function testDelete()
99 99
 	{
100
-		$this->assertNotNull( $this->object->delete() );
100
+		$this->assertNotNull($this->object->delete());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testDeleteException()
105 105
 	{
106
-		$object = $this->getClientMock( 'getSubClients' );
106
+		$object = $this->getClientMock('getSubClients');
107 107
 
108
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->exactly(2))->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$object->delete();
112 112
 	}
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
 	public function testDeleteMShopException()
116 116
 	{
117
-		$object = $this->getClientMock( 'getSubClients' );
117
+		$object = $this->getClientMock('getSubClients');
118 118
 
119
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
120
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
119
+		$object->expects($this->exactly(2))->method('getSubClients')
120
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
121 121
 
122 122
 		$object->delete();
123 123
 	}
@@ -125,21 +125,21 @@  discard block
 block discarded – undo
125 125
 
126 126
 	public function testGet()
127 127
 	{
128
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
129
-		$this->view->addHelper( 'param', $helper );
128
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
129
+		$this->view->addHelper('param', $helper);
130 130
 
131 131
 		$result = $this->object->get();
132 132
 
133
-		$this->assertContains( 'de', $result );
133
+		$this->assertContains('de', $result);
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testGetException()
138 138
 	{
139
-		$object = $this->getClientMock( 'getSubClients' );
139
+		$object = $this->getClientMock('getSubClients');
140 140
 
141
-		$object->expects( $this->once() )->method( 'getSubClients' )
142
-			->will( $this->throwException( new \RuntimeException() ) );
141
+		$object->expects($this->once())->method('getSubClients')
142
+			->will($this->throwException(new \RuntimeException()));
143 143
 
144 144
 		$object->get();
145 145
 	}
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 
148 148
 	public function testGetMShopException()
149 149
 	{
150
-		$object = $this->getClientMock( 'getSubClients' );
150
+		$object = $this->getClientMock('getSubClients');
151 151
 
152
-		$object->expects( $this->once() )->method( 'getSubClients' )
153
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
152
+		$object->expects($this->once())->method('getSubClients')
153
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
154 154
 
155 155
 		$object->get();
156 156
 	}
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGetViewException()
160 160
 	{
161
-		$object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard( $this->context, [] );
161
+		$object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard($this->context, []);
162 162
 
163
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
163
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/language' );
170
+		$manager = \Aimeos\MShop::create($this->context, 'locale/language');
171 171
 
172 172
 		$param = array(
173 173
 			'item' => array(
@@ -178,24 +178,24 @@  discard block
 block discarded – undo
178 178
 			),
179 179
 		);
180 180
 
181
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
182
-		$this->view->addHelper( 'param', $helper );
181
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
182
+		$this->view->addHelper('param', $helper);
183 183
 
184 184
 		$this->object->save();
185 185
 
186
-		$item = $manager->findItem( 'xx' );
187
-		$manager->deleteItem( $item->getId() );
186
+		$item = $manager->findItem('xx');
187
+		$manager->deleteItem($item->getId());
188 188
 
189
-		$this->assertEquals( 'jqadm test', $item->getLabel() );
189
+		$this->assertEquals('jqadm test', $item->getLabel());
190 190
 	}
191 191
 
192 192
 
193 193
 	public function testSaveException()
194 194
 	{
195
-		$object = $this->getClientMock( 'fromArray' );
195
+		$object = $this->getClientMock('fromArray');
196 196
 
197
-		$object->expects( $this->once() )->method( 'fromArray' )
198
-			->will( $this->throwException( new \RuntimeException() ) );
197
+		$object->expects($this->once())->method('fromArray')
198
+			->will($this->throwException(new \RuntimeException()));
199 199
 
200 200
 		$object->save();
201 201
 	}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 
204 204
 	public function testSaveMShopException()
205 205
 	{
206
-		$object = $this->getClientMock( 'fromArray' );
206
+		$object = $this->getClientMock('fromArray');
207 207
 
208
-		$object->expects( $this->once() )->method( 'fromArray' )
209
-			->will( $this->throwException( new \RuntimeException() ) );
208
+		$object->expects($this->once())->method('fromArray')
209
+			->will($this->throwException(new \RuntimeException()));
210 210
 
211 211
 		$object->save();
212 212
 	}
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 	public function testSaveJQAdmException()
216 216
 	{
217
-		$object = $this->getClientMock( 'fromArray' );
217
+		$object = $this->getClientMock('fromArray');
218 218
 
219
-		$object->expects( $this->once() )->method( 'fromArray' )
220
-			->will( $this->throwException( new \RuntimeException() ) );
219
+		$object->expects($this->once())->method('fromArray')
220
+			->will($this->throwException(new \RuntimeException()));
221 221
 
222 222
 		$object->save();
223 223
 	}
@@ -228,27 +228,27 @@  discard block
 block discarded – undo
228 228
 		$param = array(
229 229
 			'lang' => 'de',
230 230
 			'filter' => array(
231
-				'key' => array( 0 => 'locale.language.code' ),
232
-				'op' => array( 0 => '==' ),
233
-				'val' => array( 0 => 'de' ),
231
+				'key' => array(0 => 'locale.language.code'),
232
+				'op' => array(0 => '=='),
233
+				'val' => array(0 => 'de'),
234 234
 			),
235
-			'sort' => array( '-locale.language.id' ),
235
+			'sort' => array('-locale.language.id'),
236 236
 		);
237
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
238
-		$this->view->addHelper( 'param', $helper );
237
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
238
+		$this->view->addHelper('param', $helper);
239 239
 
240 240
 		$result = $this->object->search();
241 241
 
242
-		$this->assertContains( '>de<', $result );
242
+		$this->assertContains('>de<', $result);
243 243
 	}
244 244
 
245 245
 
246 246
 	public function testSearchException()
247 247
 	{
248
-		$object = $this->getClientMock( 'initCriteria' );
248
+		$object = $this->getClientMock('initCriteria');
249 249
 
250
-		$object->expects( $this->once() )->method( 'initCriteria' )
251
-			->will( $this->throwException( new \RuntimeException() ) );
250
+		$object->expects($this->once())->method('initCriteria')
251
+			->will($this->throwException(new \RuntimeException()));
252 252
 
253 253
 		$object->search();
254 254
 	}
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 	public function testSearchMShopException()
258 258
 	{
259
-		$object = $this->getClientMock( 'initCriteria' );
259
+		$object = $this->getClientMock('initCriteria');
260 260
 
261
-		$object->expects( $this->once() )->method( 'initCriteria' )
262
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
261
+		$object->expects($this->once())->method('initCriteria')
262
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
263 263
 
264 264
 		$object->search();
265 265
 	}
@@ -267,27 +267,27 @@  discard block
 block discarded – undo
267 267
 
268 268
 	public function testGetSubClientInvalid()
269 269
 	{
270
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
271
+		$this->object->getSubClient('$unknown$');
272 272
 	}
273 273
 
274 274
 
275 275
 	public function testGetSubClientUnknown()
276 276
 	{
277
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
278
+		$this->object->getSubClient('unknown');
279 279
 	}
280 280
 
281 281
 
282
-	public function getClientMock( $method )
282
+	public function getClientMock($method)
283 283
 	{
284
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Language\Standard::class )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Language\Standard::class)
285
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
286
+			->setMethods([$method])
287 287
 			->getMock();
288 288
 
289
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
290
-		$object->setView( $this->getViewNoRender() );
289
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
290
+		$object->setView($this->getViewNoRender());
291 291
 
292 292
 		return $object;
293 293
 	}
@@ -295,16 +295,16 @@  discard block
 block discarded – undo
295 295
 
296 296
 	protected function getViewNoRender()
297 297
 	{
298
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
299
+			->setConstructorArgs(array([]))
300
+			->setMethods(array('render', 'config'))
301 301
 			->getMock();
302 302
 
303
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
304
-		$view->addHelper( 'param', $helper );
303
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
304
+		$view->addHelper('param', $helper);
305 305
 
306
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
307
-		$view->addHelper( 'access', $helper );
306
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
307
+		$view->addHelper('access', $helper);
308 308
 
309 309
 		return $view;
310 310
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/StandardTest.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Locale\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Locale\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getClientMock( 'getSubClients' );
45
+		$object = $this->getClientMock('getSubClients');
46 46
 
47
-		$object->expects( $this->once() )->method( 'getSubClients' )
48
-			->will( $this->throwException( new \RuntimeException() ) );
47
+		$object->expects($this->once())->method('getSubClients')
48
+			->will($this->throwException(new \RuntimeException()));
49 49
 
50 50
 		$object->create();
51 51
 	}
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	public function testCreateMShopException()
55 55
 	{
56
-		$object = $this->getClientMock( 'getSubClients' );
56
+		$object = $this->getClientMock('getSubClients');
57 57
 
58
-		$object->expects( $this->once() )->method( 'getSubClients' )
59
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
58
+		$object->expects($this->once())->method('getSubClients')
59
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
60 60
 
61 61
 		$object->create();
62 62
 	}
@@ -64,22 +64,22 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$param = ['site' => 'unittest', 'id' => $this->getItem( 'de', 'EUR' )->getId()];
68
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
69
-		$this->view->addHelper( 'param', $helper );
67
+		$param = ['site' => 'unittest', 'id' => $this->getItem('de', 'EUR')->getId()];
68
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
69
+		$this->view->addHelper('param', $helper);
70 70
 
71 71
 		$result = $this->object->copy();
72 72
 
73
-		$this->assertContains( 'EUR', $result );
73
+		$this->assertContains('EUR', $result);
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testCopyException()
78 78
 	{
79
-		$object = $this->getClientMock( 'getSubClients' );
79
+		$object = $this->getClientMock('getSubClients');
80 80
 
81
-		$object->expects( $this->once() )->method( 'getSubClients' )
82
-			->will( $this->throwException( new \RuntimeException() ) );
81
+		$object->expects($this->once())->method('getSubClients')
82
+			->will($this->throwException(new \RuntimeException()));
83 83
 
84 84
 		$object->copy();
85 85
 	}
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 
88 88
 	public function testCopyMShopException()
89 89
 	{
90
-		$object = $this->getClientMock( 'getSubClients' );
90
+		$object = $this->getClientMock('getSubClients');
91 91
 
92
-		$object->expects( $this->once() )->method( 'getSubClients' )
93
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
92
+		$object->expects($this->once())->method('getSubClients')
93
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
94 94
 
95 95
 		$object->copy();
96 96
 	}
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
 
99 99
 	public function testDelete()
100 100
 	{
101
-		$this->assertNotNull( $this->object->delete() );
101
+		$this->assertNotNull($this->object->delete());
102 102
 	}
103 103
 
104 104
 
105 105
 	public function testDeleteException()
106 106
 	{
107
-		$object = $this->getClientMock( 'getSubClients' );
107
+		$object = $this->getClientMock('getSubClients');
108 108
 
109
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
110
-			->will( $this->throwException( new \RuntimeException() ) );
109
+		$object->expects($this->exactly(2))->method('getSubClients')
110
+			->will($this->throwException(new \RuntimeException()));
111 111
 
112 112
 		$object->delete();
113 113
 	}
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 
116 116
 	public function testDeleteMShopException()
117 117
 	{
118
-		$object = $this->getClientMock( 'getSubClients' );
118
+		$object = $this->getClientMock('getSubClients');
119 119
 
120
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
121
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
120
+		$object->expects($this->exactly(2))->method('getSubClients')
121
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
122 122
 
123 123
 		$object->delete();
124 124
 	}
@@ -126,22 +126,22 @@  discard block
 block discarded – undo
126 126
 
127 127
 	public function testGet()
128 128
 	{
129
-		$param = ['site' => 'unittest', 'id' => $this->getItem( 'de', 'EUR' )->getId()];
130
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
131
-		$this->view->addHelper( 'param', $helper );
129
+		$param = ['site' => 'unittest', 'id' => $this->getItem('de', 'EUR')->getId()];
130
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
131
+		$this->view->addHelper('param', $helper);
132 132
 
133 133
 		$result = $this->object->get();
134 134
 
135
-		$this->assertContains( 'EUR', $result );
135
+		$this->assertContains('EUR', $result);
136 136
 	}
137 137
 
138 138
 
139 139
 	public function testGetException()
140 140
 	{
141
-		$object = $this->getClientMock( 'getSubClients' );
141
+		$object = $this->getClientMock('getSubClients');
142 142
 
143
-		$object->expects( $this->once() )->method( 'getSubClients' )
144
-			->will( $this->throwException( new \RuntimeException() ) );
143
+		$object->expects($this->once())->method('getSubClients')
144
+			->will($this->throwException(new \RuntimeException()));
145 145
 
146 146
 		$object->get();
147 147
 	}
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 
150 150
 	public function testGetMShopException()
151 151
 	{
152
-		$object = $this->getClientMock( 'getSubClients' );
152
+		$object = $this->getClientMock('getSubClients');
153 153
 
154
-		$object->expects( $this->once() )->method( 'getSubClients' )
155
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
154
+		$object->expects($this->once())->method('getSubClients')
155
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
156 156
 
157 157
 		$object->get();
158 158
 	}
@@ -160,16 +160,16 @@  discard block
 block discarded – undo
160 160
 
161 161
 	public function testGetViewException()
162 162
 	{
163
-		$object = new \Aimeos\Admin\JQAdm\Locale\Standard( $this->context, [] );
163
+		$object = new \Aimeos\Admin\JQAdm\Locale\Standard($this->context, []);
164 164
 
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->getView();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSave()
171 171
 	{
172
-		$manager = \Aimeos\MShop::create( $this->context, 'locale' );
172
+		$manager = \Aimeos\MShop::create($this->context, 'locale');
173 173
 
174 174
 		$param = array(
175 175
 			'site' => 'unittest',
@@ -182,21 +182,21 @@  discard block
 block discarded – undo
182 182
 			),
183 183
 		);
184 184
 
185
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
186
-		$this->view->addHelper( 'param', $helper );
185
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
186
+		$this->view->addHelper('param', $helper);
187 187
 
188 188
 		$this->object->save();
189 189
 
190
-		$manager->deleteItem( $this->getItem( 'da', 'DKK' )->getId() );
190
+		$manager->deleteItem($this->getItem('da', 'DKK')->getId());
191 191
 	}
192 192
 
193 193
 
194 194
 	public function testSaveException()
195 195
 	{
196
-		$object = $this->getClientMock( 'fromArray' );
196
+		$object = $this->getClientMock('fromArray');
197 197
 
198
-		$object->expects( $this->once() )->method( 'fromArray' )
199
-			->will( $this->throwException( new \RuntimeException() ) );
198
+		$object->expects($this->once())->method('fromArray')
199
+			->will($this->throwException(new \RuntimeException()));
200 200
 
201 201
 		$object->save();
202 202
 	}
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testSaveMShopException()
206 206
 	{
207
-		$object = $this->getClientMock( 'fromArray' );
207
+		$object = $this->getClientMock('fromArray');
208 208
 
209
-		$object->expects( $this->once() )->method( 'fromArray' )
210
-			->will( $this->throwException( new \RuntimeException() ) );
209
+		$object->expects($this->once())->method('fromArray')
210
+			->will($this->throwException(new \RuntimeException()));
211 211
 
212 212
 		$object->save();
213 213
 	}
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 
216 216
 	public function testSaveJQAdmException()
217 217
 	{
218
-		$object = $this->getClientMock( 'fromArray' );
218
+		$object = $this->getClientMock('fromArray');
219 219
 
220
-		$object->expects( $this->once() )->method( 'fromArray' )
221
-			->will( $this->throwException( new \RuntimeException() ) );
220
+		$object->expects($this->once())->method('fromArray')
221
+			->will($this->throwException(new \RuntimeException()));
222 222
 
223 223
 		$object->save();
224 224
 	}
@@ -229,27 +229,27 @@  discard block
 block discarded – undo
229 229
 		$param = array(
230 230
 			'site' => 'unittest', 'lang' => 'de',
231 231
 			'filter' => array(
232
-				'key' => array( 0 => 'locale.languageid' ),
233
-				'op' => array( 0 => '==' ),
234
-				'val' => array( 0 => 'de' ),
232
+				'key' => array(0 => 'locale.languageid'),
233
+				'op' => array(0 => '=='),
234
+				'val' => array(0 => 'de'),
235 235
 			),
236
-			'sort' => array( 'locale.position', '-locale.id' ),
236
+			'sort' => array('locale.position', '-locale.id'),
237 237
 		);
238
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
239
-		$this->view->addHelper( 'param', $helper );
238
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
239
+		$this->view->addHelper('param', $helper);
240 240
 
241 241
 		$result = $this->object->search();
242 242
 
243
-		$this->assertContains( '>EUR<', $result );
243
+		$this->assertContains('>EUR<', $result);
244 244
 	}
245 245
 
246 246
 
247 247
 	public function testSearchException()
248 248
 	{
249
-		$object = $this->getClientMock( 'initCriteria' );
249
+		$object = $this->getClientMock('initCriteria');
250 250
 
251
-		$object->expects( $this->once() )->method( 'initCriteria' )
252
-			->will( $this->throwException( new \RuntimeException() ) );
251
+		$object->expects($this->once())->method('initCriteria')
252
+			->will($this->throwException(new \RuntimeException()));
253 253
 
254 254
 		$object->search();
255 255
 	}
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 
258 258
 	public function testSearchMShopException()
259 259
 	{
260
-		$object = $this->getClientMock( 'initCriteria' );
260
+		$object = $this->getClientMock('initCriteria');
261 261
 
262
-		$object->expects( $this->once() )->method( 'initCriteria' )
263
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
262
+		$object->expects($this->once())->method('initCriteria')
263
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
264 264
 
265 265
 		$object->search();
266 266
 	}
@@ -268,27 +268,27 @@  discard block
 block discarded – undo
268 268
 
269 269
 	public function testGetSubClientInvalid()
270 270
 	{
271
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
272
-		$this->object->getSubClient( '$unknown$' );
271
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
272
+		$this->object->getSubClient('$unknown$');
273 273
 	}
274 274
 
275 275
 
276 276
 	public function testGetSubClientUnknown()
277 277
 	{
278
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
279
-		$this->object->getSubClient( 'unknown' );
278
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
279
+		$this->object->getSubClient('unknown');
280 280
 	}
281 281
 
282 282
 
283
-	public function getClientMock( $method )
283
+	public function getClientMock($method)
284 284
 	{
285
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Standard::class )
286
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
287
-			->setMethods( [$method] )
285
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Standard::class)
286
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
287
+			->setMethods([$method])
288 288
 			->getMock();
289 289
 
290
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
291
-		$object->setView( $this->getViewNoRender() );
290
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
291
+		$object->setView($this->getViewNoRender());
292 292
 
293 293
 		return $object;
294 294
 	}
@@ -296,45 +296,45 @@  discard block
 block discarded – undo
296 296
 
297 297
 	protected function getViewNoRender()
298 298
 	{
299
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
300
-			->setConstructorArgs( array( [] ) )
301
-			->setMethods( array( 'render', 'config' ) )
299
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
300
+			->setConstructorArgs(array([]))
301
+			->setMethods(array('render', 'config'))
302 302
 			->getMock();
303 303
 
304 304
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
305
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
306
-		$view->addHelper( 'param', $helper );
305
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
306
+		$view->addHelper('param', $helper);
307 307
 
308
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
309
-		$view->addHelper( 'access', $helper );
308
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
309
+		$view->addHelper('access', $helper);
310 310
 
311 311
 		return $view;
312 312
 	}
313 313
 
314 314
 
315
-	protected function getItem( $langid = null, $currid = null )
315
+	protected function getItem($langid = null, $currid = null)
316 316
 	{
317
-		$manager = \Aimeos\MShop::create( $this->context, 'locale' );
317
+		$manager = \Aimeos\MShop::create($this->context, 'locale');
318 318
 
319 319
 		$search = $manager->createSearch();
320
-		$search->setSlice( 0, 1 );
320
+		$search->setSlice(0, 1);
321 321
 
322 322
 		$expr = [];
323 323
 
324
-		if( $langid ) {
325
-			$expr[] = $search->compare( '==', 'locale.languageid', $langid );
324
+		if ($langid) {
325
+			$expr[] = $search->compare('==', 'locale.languageid', $langid);
326 326
 		}
327 327
 
328
-		if( $currid ) {
329
-			$expr[] = $search->compare( '==', 'locale.currencyid', $currid );
328
+		if ($currid) {
329
+			$expr[] = $search->compare('==', 'locale.currencyid', $currid);
330 330
 		}
331 331
 
332
-		$search->setConditions( $search->combine( '&&', $expr ) );
332
+		$search->setConditions($search->combine('&&', $expr));
333 333
 
334
-		$items = $manager->searchItems( $search );
334
+		$items = $manager->searchItems($search);
335 335
 
336
-		if( ( $item = reset( $items ) ) === false ) {
337
-			throw new \Exception( sprintf( 'No locale found' ) );
336
+		if (($item = reset($items)) === false) {
337
+			throw new \Exception(sprintf('No locale found'));
338 338
 		}
339 339
 
340 340
 		return $item;
Please login to merge, or discard this patch.