Completed
Push — master ( 0229de...f71bfb )
by Aimeos
04:41
created
admin/jqadm/templates/service/list-standard.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -8,30 +8,30 @@  discard block
 block discarded – undo
8 8
 $enc = $this->encoder();
9 9
 
10 10
 
11
-$target = $this->config( 'admin/jqadm/url/search/target' );
12
-$controller = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' );
13
-$action = $this->config( 'admin/jqadm/url/search/action', 'search' );
14
-$config = $this->config( 'admin/jqadm/url/search/config', [] );
11
+$target = $this->config('admin/jqadm/url/search/target');
12
+$controller = $this->config('admin/jqadm/url/search/controller', 'Jqadm');
13
+$action = $this->config('admin/jqadm/url/search/action', 'search');
14
+$config = $this->config('admin/jqadm/url/search/config', []);
15 15
 
16
-$newTarget = $this->config( 'admin/jqadm/url/create/target' );
17
-$newCntl = $this->config( 'admin/jqadm/url/create/controller', 'Jqadm' );
18
-$newAction = $this->config( 'admin/jqadm/url/create/action', 'create' );
19
-$newConfig = $this->config( 'admin/jqadm/url/create/config', [] );
16
+$newTarget = $this->config('admin/jqadm/url/create/target');
17
+$newCntl = $this->config('admin/jqadm/url/create/controller', 'Jqadm');
18
+$newAction = $this->config('admin/jqadm/url/create/action', 'create');
19
+$newConfig = $this->config('admin/jqadm/url/create/config', []);
20 20
 
21
-$getTarget = $this->config( 'admin/jqadm/url/get/target' );
22
-$getCntl = $this->config( 'admin/jqadm/url/get/controller', 'Jqadm' );
23
-$getAction = $this->config( 'admin/jqadm/url/get/action', 'get' );
24
-$getConfig = $this->config( 'admin/jqadm/url/get/config', [] );
21
+$getTarget = $this->config('admin/jqadm/url/get/target');
22
+$getCntl = $this->config('admin/jqadm/url/get/controller', 'Jqadm');
23
+$getAction = $this->config('admin/jqadm/url/get/action', 'get');
24
+$getConfig = $this->config('admin/jqadm/url/get/config', []);
25 25
 
26
-$copyTarget = $this->config( 'admin/jqadm/url/copy/target' );
27
-$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' );
28
-$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' );
29
-$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] );
26
+$copyTarget = $this->config('admin/jqadm/url/copy/target');
27
+$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm');
28
+$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy');
29
+$copyConfig = $this->config('admin/jqadm/url/copy/config', []);
30 30
 
31
-$delTarget = $this->config( 'admin/jqadm/url/delete/target' );
32
-$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' );
33
-$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' );
34
-$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] );
31
+$delTarget = $this->config('admin/jqadm/url/delete/target');
32
+$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm');
33
+$delAction = $this->config('admin/jqadm/url/delete/action', 'delete');
34
+$delConfig = $this->config('admin/jqadm/url/delete/config', []);
35 35
 
36 36
 
37 37
 /** admin/jqadm/service/fields
@@ -49,48 +49,48 @@  discard block
 block discarded – undo
49 49
  * @category Developer
50 50
  */
51 51
 $default = ['service.status', 'service.type', 'service.label', 'service.provider'];
52
-$default = $this->config( 'admin/jqadm/service/fields', $default );
53
-$fields = $this->session( 'aimeos/admin/jqadm/service/fields', $default );
52
+$default = $this->config('admin/jqadm/service/fields', $default);
53
+$fields = $this->session('aimeos/admin/jqadm/service/fields', $default);
54 54
 
55
-$searchParams = $params = $this->get( 'pageParams', [] );
55
+$searchParams = $params = $this->get('pageParams', []);
56 56
 $searchParams['page']['start'] = 0;
57 57
 
58 58
 $typeList = [];
59
-foreach( $this->get( 'itemTypes', [] ) as $typeItem ) {
59
+foreach ($this->get('itemTypes', []) as $typeItem) {
60 60
 	$typeList[$typeItem->getCode()] = $typeItem->getCode();
61 61
 }
62 62
 
63 63
 $columnList = [
64
-	'service.id' => $this->translate( 'admin', 'ID' ),
65
-	'service.status' => $this->translate( 'admin', 'Status' ),
66
-	'service.type' => $this->translate( 'admin', 'Type' ),
67
-	'service.position' => $this->translate( 'admin', 'Position' ),
68
-	'service.code' => $this->translate( 'admin', 'Code' ),
69
-	'service.label' => $this->translate( 'admin', 'Label' ),
70
-	'service.provider' => $this->translate( 'admin', 'Provider' ),
71
-	'service.datestart' => $this->translate( 'admin', 'Start date' ),
72
-	'service.dateend' => $this->translate( 'admin', 'End date' ),
73
-	'service.config' => $this->translate( 'admin', 'Config' ),
74
-	'service.ctime' => $this->translate( 'admin', 'Created' ),
75
-	'service.mtime' => $this->translate( 'admin', 'Modified' ),
76
-	'service.editor' => $this->translate( 'admin', 'Editor' ),
64
+	'service.id' => $this->translate('admin', 'ID'),
65
+	'service.status' => $this->translate('admin', 'Status'),
66
+	'service.type' => $this->translate('admin', 'Type'),
67
+	'service.position' => $this->translate('admin', 'Position'),
68
+	'service.code' => $this->translate('admin', 'Code'),
69
+	'service.label' => $this->translate('admin', 'Label'),
70
+	'service.provider' => $this->translate('admin', 'Provider'),
71
+	'service.datestart' => $this->translate('admin', 'Start date'),
72
+	'service.dateend' => $this->translate('admin', 'End date'),
73
+	'service.config' => $this->translate('admin', 'Config'),
74
+	'service.ctime' => $this->translate('admin', 'Created'),
75
+	'service.mtime' => $this->translate('admin', 'Modified'),
76
+	'service.editor' => $this->translate('admin', 'Editor'),
77 77
 ];
78 78
 
79 79
 ?>
80
-<?php $this->block()->start( 'jqadm_content' ); ?>
80
+<?php $this->block()->start('jqadm_content'); ?>
81 81
 
82 82
 <nav class="main-navbar">
83 83
 
84 84
 	<span class="navbar-brand">
85
-		<?= $enc->html( $this->translate( 'admin', 'Service' ) ); ?>
86
-		<span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span>
85
+		<?= $enc->html($this->translate('admin', 'Service')); ?>
86
+		<span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span>
87 87
 	</span>
88 88
 
89 89
 	<?= $this->partial(
90
-		$this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard' ), [
91
-			'filter' => $this->session( 'aimeos/admin/jqadm/service/filter', [] ),
92
-			'filterAttributes' => $this->get( 'filterAttributes', [] ),
93
-			'filterOperators' => $this->get( 'filterOperators', [] ),
90
+		$this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard'), [
91
+			'filter' => $this->session('aimeos/admin/jqadm/service/filter', []),
92
+			'filterAttributes' => $this->get('filterAttributes', []),
93
+			'filterOperators' => $this->get('filterOperators', []),
94 94
 			'params' => $params,
95 95
 		]
96 96
 	); ?>
@@ -98,33 +98,33 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 <?= $this->partial(
101
-		$this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ),
102
-		['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ),
103
-		'page' => $this->session( 'aimeos/admin/jqadm/service/page', [] )]
101
+		$this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'),
102
+		['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'),
103
+		'page' => $this->session('aimeos/admin/jqadm/service/page', [])]
104 104
 	);
105 105
 ?>
106 106
 
107
-<form class="list list-product" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>">
107
+<form class="list list-product" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>">
108 108
 	<?= $this->csrf()->formfield(); ?>
109 109
 
110 110
 	<table class="list-items table table-hover table-striped">
111 111
 		<thead class="list-header">
112 112
 			<tr>
113 113
 				<?= $this->partial(
114
-						$this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard' ),
115
-						['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/service/sort' )]
114
+						$this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard'),
115
+						['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/service/sort')]
116 116
 					);
117 117
 				?>
118 118
 
119 119
 				<th class="actions">
120 120
 					<a class="btn fa act-add" tabindex="1"
121
-						href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>"
122
-						title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"
123
-						aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>">
121
+						href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>"
122
+						title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"
123
+						aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>">
124 124
 					</a>
125 125
 
126 126
 					<?= $this->partial(
127
-							$this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard' ),
127
+							$this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard'),
128 128
 							['fields' => $fields, 'data' => $columnList]
129 129
 						);
130 130
 					?>
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
 		<tbody>
135 135
 
136 136
 			<?= $this->partial(
137
-				$this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard' ), [
138
-					'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/service/filter', [] ),
137
+				$this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard'), [
138
+					'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/service/filter', []),
139 139
 					'data' => [
140 140
 						'service.id' => ['op' => '=='],
141 141
 						'service.status' => ['op' => '==', 'type' => 'select', 'val' => [
142
-							'1' => $this->translate( 'mshop/code', 'status:1' ),
143
-							'0' => $this->translate( 'mshop/code', 'status:0' ),
144
-							'-1' => $this->translate( 'mshop/code', 'status:-1' ),
145
-							'-2' => $this->translate( 'mshop/code', 'status:-2' ),
142
+							'1' => $this->translate('mshop/code', 'status:1'),
143
+							'0' => $this->translate('mshop/code', 'status:0'),
144
+							'-1' => $this->translate('mshop/code', 'status:-1'),
145
+							'-2' => $this->translate('mshop/code', 'status:-2'),
146 146
 						]],
147 147
 						'service.type' => ['op' => '==', 'type' => 'select', 'val' => $typeList],
148 148
 						'service.position' => ['op' => '>=', 'type' => 'number'],
@@ -159,67 +159,67 @@  discard block
 block discarded – undo
159 159
 				] );
160 160
 			?>
161 161
 
162
-			<?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?>
163
-				<?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?>
164
-				<tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>">
165
-					<?php if( in_array( 'service.id', $fields ) ) : ?>
166
-						<td class="service-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td>
162
+			<?php foreach ($this->get('items', []) as $id => $item) : ?>
163
+				<?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?>
164
+				<tr class="<?= $this->site()->readonly($item->getSiteId()); ?>">
165
+					<?php if (in_array('service.id', $fields)) : ?>
166
+						<td class="service-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td>
167 167
 					<?php endif; ?>
168
-					<?php if( in_array( 'service.status', $fields ) ) : ?>
169
-						<td class="service-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td>
168
+					<?php if (in_array('service.status', $fields)) : ?>
169
+						<td class="service-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td>
170 170
 					<?php endif; ?>
171
-					<?php if( in_array( 'service.type', $fields ) ) : ?>
172
-						<td class="service-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getType() ); ?></a></td>
171
+					<?php if (in_array('service.type', $fields)) : ?>
172
+						<td class="service-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getType()); ?></a></td>
173 173
 					<?php endif; ?>
174
-					<?php if( in_array( 'service.position', $fields ) ) : ?>
175
-						<td class="service-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getPosition() ); ?></a></td>
174
+					<?php if (in_array('service.position', $fields)) : ?>
175
+						<td class="service-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getPosition()); ?></a></td>
176 176
 					<?php endif; ?>
177
-					<?php if( in_array( 'service.code', $fields ) ) : ?>
178
-						<td class="service-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getCode() ); ?></a></td>
177
+					<?php if (in_array('service.code', $fields)) : ?>
178
+						<td class="service-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getCode()); ?></a></td>
179 179
 					<?php endif; ?>
180
-					<?php if( in_array( 'service.label', $fields ) ) : ?>
181
-						<td class="service-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getLabel() ); ?></a></td>
180
+					<?php if (in_array('service.label', $fields)) : ?>
181
+						<td class="service-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getLabel()); ?></a></td>
182 182
 					<?php endif; ?>
183
-					<?php if( in_array( 'service.provider', $fields ) ) : ?>
184
-						<td class="service-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getProvider() ); ?></a></td>
183
+					<?php if (in_array('service.provider', $fields)) : ?>
184
+						<td class="service-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getProvider()); ?></a></td>
185 185
 					<?php endif; ?>
186
-					<?php if( in_array( 'service.datestart', $fields ) ) : ?>
187
-						<td class="service-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateStart() ); ?></a></td>
186
+					<?php if (in_array('service.datestart', $fields)) : ?>
187
+						<td class="service-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateStart()); ?></a></td>
188 188
 					<?php endif; ?>
189
-					<?php if( in_array( 'service.dateend', $fields ) ) : ?>
190
-						<td class="service-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateEnd() ); ?></a></td>
189
+					<?php if (in_array('service.dateend', $fields)) : ?>
190
+						<td class="service-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateEnd()); ?></a></td>
191 191
 					<?php endif; ?>
192
-					<?php if( in_array( 'service.config', $fields ) ) : ?>
192
+					<?php if (in_array('service.config', $fields)) : ?>
193 193
 						<td class="service-config config-item">
194 194
 							<a class="items-field" href="<?= $url; ?>">
195
-								<?php foreach( $item->getConfig() as $key => $value ) : ?>
196
-									<span class="config-key"><?= $enc->html( $key ); ?></span>
197
-									<span class="config-value"><?= $enc->html( !is_scalar( $value ) ? json_encode( $value ) : $value ); ?></span>
195
+								<?php foreach ($item->getConfig() as $key => $value) : ?>
196
+									<span class="config-key"><?= $enc->html($key); ?></span>
197
+									<span class="config-value"><?= $enc->html(!is_scalar($value) ? json_encode($value) : $value); ?></span>
198 198
 									<br/>
199 199
 								<?php endforeach; ?>
200 200
 							</a>
201 201
 						</td>
202 202
 					<?php endif; ?>
203
-					<?php if( in_array( 'service.ctime', $fields ) ) : ?>
204
-						<td class="service-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td>
203
+					<?php if (in_array('service.ctime', $fields)) : ?>
204
+						<td class="service-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td>
205 205
 					<?php endif; ?>
206
-					<?php if( in_array( 'service.mtime', $fields ) ) : ?>
207
-						<td class="service-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td>
206
+					<?php if (in_array('service.mtime', $fields)) : ?>
207
+						<td class="service-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td>
208 208
 					<?php endif; ?>
209
-					<?php if( in_array( 'service.editor', $fields ) ) : ?>
210
-						<td class="service-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td>
209
+					<?php if (in_array('service.editor', $fields)) : ?>
210
+						<td class="service-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td>
211 211
 					<?php endif; ?>
212 212
 
213 213
 					<td class="actions">
214 214
 						<a class="btn act-copy fa" tabindex="1"
215
-							href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>"
216
-							title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>"
217
-							aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a>
218
-						<?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?>
215
+							href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>"
216
+							title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>"
217
+							aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a>
218
+						<?php if (!$this->site()->readonly($item->getSiteId())) : ?>
219 219
 							<a class="btn act-delete fa" tabindex="1"
220
-								href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'service', 'id' => $id] + $params, [], $delConfig ) ); ?>"
221
-								title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"
222
-								aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a>
220
+								href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'service', 'id' => $id] + $params, [], $delConfig)); ?>"
221
+								title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"
222
+								aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a>
223 223
 						<?php endif; ?>
224 224
 					</td>
225 225
 				</tr>
@@ -227,18 +227,18 @@  discard block
 block discarded – undo
227 227
 		</tbody>
228 228
 	</table>
229 229
 
230
-	<?php if( $this->get( 'items', [] ) === [] ) : ?>
231
-		<?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?>
230
+	<?php if ($this->get('items', []) === []) : ?>
231
+		<?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?>
232 232
 	<?php endif; ?>
233 233
 </form>
234 234
 
235 235
 <?= $this->partial(
236
-		$this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ),
237
-		['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ),
238
-		'page' => $this->session( 'aimeos/admin/jqadm/service/page', [] )]
236
+		$this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'),
237
+		['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'),
238
+		'page' => $this->session('aimeos/admin/jqadm/service/page', [])]
239 239
 	);
240 240
 ?>
241 241
 
242 242
 <?php $this->block()->stop(); ?>
243 243
 
244
-<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard' ) ); ?>
244
+<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard')); ?>
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdmTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -19,52 +19,52 @@
 block discarded – undo
19 19
 	{
20 20
 		$this->aimeos = \TestHelperJqadm::getAimeos();
21 21
 		$this->context = \TestHelperJqadm::getContext();
22
-		$this->context->setView( \TestHelperJqadm::getView() );
22
+		$this->context->setView(\TestHelperJqadm::getView());
23 23
 	}
24 24
 
25 25
 
26 26
 	public function testCreateClient()
27 27
 	{
28
-		$this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] );
29
-		$client = \Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, 'product' );
30
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
28
+		$this->context->getConfig()->set('admin/jqadm/resources', ['product']);
29
+		$client = \Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, 'product');
30
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testCreateClientName()
35 35
 	{
36
-		$this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] );
37
-		$client = \Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, 'product', 'Standard' );
38
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
36
+		$this->context->getConfig()->set('admin/jqadm/resources', ['product']);
37
+		$client = \Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, 'product', 'Standard');
38
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreateSubClient()
43 43
 	{
44
-		$this->context->getConfig()->set( 'admin/jqadm/resources', ['locale/site'] );
45
-		$client = \Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, 'locale/site' );
46
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
44
+		$this->context->getConfig()->set('admin/jqadm/resources', ['locale/site']);
45
+		$client = \Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, 'locale/site');
46
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
47 47
 	}
48 48
 
49 49
 
50 50
 	public function testCreateClientNameEmpty()
51 51
 	{
52
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
53
-		\Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, '' );
52
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
53
+		\Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, '');
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testCreateClientNameInvalid()
58 58
 	{
59
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
60
-		\Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, '%product' );
59
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
60
+		\Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, '%product');
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testCreateClientNameNotFound()
65 65
 	{
66
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
67
-		\Aimeos\Admin\JQAdm::create( $this->context, $this->aimeos, 'unknown' );
66
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
67
+		\Aimeos\Admin\JQAdm::create($this->context, $this->aimeos, 'unknown');
68 68
 	}
69 69
 
70 70
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Catalog/Product/StandardTest.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  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\Catalog\Product\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\Catalog\Product\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 testCopy()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
40
-		$this->view->item = $manager->findItem( 'cafe' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
40
+		$this->view->item = $manager->findItem('cafe');
41 41
 
42 42
 		$result = $this->object->copy();
43 43
 
44
-		$this->assertContains( 'item-product', $result );
44
+		$this->assertContains('item-product', $result);
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopyException()
49 49
 	{
50
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
51
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
52
-			->setMethods( array( 'getSubClients' ) )
50
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
51
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
52
+			->setMethods(array('getSubClients'))
53 53
 			->getMock();
54 54
 
55
-		$object->expects( $this->once() )->method( 'getSubClients' )
56
-			->will( $this->throwException( new \RuntimeException() ) );
55
+		$object->expects($this->once())->method('getSubClients')
56
+			->will($this->throwException(new \RuntimeException()));
57 57
 
58
-		$object->setView( $this->getViewNoRender() );
58
+		$object->setView($this->getViewNoRender());
59 59
 
60 60
 		$object->copy();
61 61
 	}
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
 
64 64
 	public function testCopyMShopException()
65 65
 	{
66
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
67
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
68
-			->setMethods( array( 'getSubClients' ) )
66
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
67
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
68
+			->setMethods(array('getSubClients'))
69 69
 			->getMock();
70 70
 
71
-		$object->expects( $this->once() )->method( 'getSubClients' )
72
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
71
+		$object->expects($this->once())->method('getSubClients')
72
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
73 73
 
74
-		$object->setView( $this->getViewNoRender() );
74
+		$object->setView($this->getViewNoRender());
75 75
 
76 76
 		$object->copy();
77 77
 	}
@@ -79,26 +79,26 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public function testCreate()
81 81
 	{
82
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
83
-		$this->view->item = $manager->findItem( 'cafe' );
82
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
83
+		$this->view->item = $manager->findItem('cafe');
84 84
 
85 85
 		$result = $this->object->create();
86 86
 
87
-		$this->assertContains( 'item-product', $result );
87
+		$this->assertContains('item-product', $result);
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testCreateException()
92 92
 	{
93
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
94
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
95
-			->setMethods( array( 'getSubClients' ) )
93
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
94
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
95
+			->setMethods(array('getSubClients'))
96 96
 			->getMock();
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \RuntimeException() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \RuntimeException()));
100 100
 
101
-		$object->setView( $this->getViewNoRender() );
101
+		$object->setView($this->getViewNoRender());
102 102
 
103 103
 		$object->create();
104 104
 	}
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 
107 107
 	public function testCreateMShopException()
108 108
 	{
109
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
110
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
111
-			->setMethods( array( 'getSubClients' ) )
109
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
110
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
111
+			->setMethods(array('getSubClients'))
112 112
 			->getMock();
113 113
 
114
-		$object->expects( $this->once() )->method( 'getSubClients' )
115
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
114
+		$object->expects($this->once())->method('getSubClients')
115
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
116 116
 
117
-		$object->setView( $this->getViewNoRender() );
117
+		$object->setView($this->getViewNoRender());
118 118
 
119 119
 		$object->create();
120 120
 	}
@@ -122,27 +122,27 @@  discard block
 block discarded – undo
122 122
 
123 123
 	public function testGet()
124 124
 	{
125
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
126
-		$this->view->item = $manager->findItem( 'cafe' );
125
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
126
+		$this->view->item = $manager->findItem('cafe');
127 127
 
128 128
 		$result = $this->object->get();
129 129
 
130
-		$this->assertContains( 'item-product', $result );
131
-		$this->assertContains( 'Cafe Noire Expresso', $result );
130
+		$this->assertContains('item-product', $result);
131
+		$this->assertContains('Cafe Noire Expresso', $result);
132 132
 	}
133 133
 
134 134
 
135 135
 	public function testGetException()
136 136
 	{
137
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
138
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
139
-			->setMethods( array( 'getSubClients' ) )
137
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
138
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
139
+			->setMethods(array('getSubClients'))
140 140
 			->getMock();
141 141
 
142
-		$object->expects( $this->once() )->method( 'getSubClients' )
143
-			->will( $this->throwException( new \RuntimeException() ) );
142
+		$object->expects($this->once())->method('getSubClients')
143
+			->will($this->throwException(new \RuntimeException()));
144 144
 
145
-		$object->setView( $this->getViewNoRender() );
145
+		$object->setView($this->getViewNoRender());
146 146
 
147 147
 		$object->get();
148 148
 	}
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
 
151 151
 	public function testGetMShopException()
152 152
 	{
153
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
154
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
155
-			->setMethods( array( 'getSubClients' ) )
153
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
154
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
155
+			->setMethods(array('getSubClients'))
156 156
 			->getMock();
157 157
 
158
-		$object->expects( $this->once() )->method( 'getSubClients' )
159
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
158
+		$object->expects($this->once())->method('getSubClients')
159
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
160 160
 
161
-		$object->setView( $this->getViewNoRender() );
161
+		$object->setView($this->getViewNoRender());
162 162
 
163 163
 		$object->get();
164 164
 	}
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 
167 167
 	public function testSave()
168 168
 	{
169
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
169
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
170 170
 
171
-		$item = $manager->findItem( 'cafe' );
172
-		$item->setCode( 'jqadm-test-save' );
173
-		$item->setId( null );
171
+		$item = $manager->findItem('cafe');
172
+		$item->setCode('jqadm-test-save');
173
+		$item->setId(null);
174 174
 
175
-		$item = $manager->insertItem( $item );
175
+		$item = $manager->insertItem($item);
176 176
 
177 177
 
178 178
 		$param = array(
@@ -188,83 +188,83 @@  discard block
 block discarded – undo
188 188
 			),
189 189
 		);
190 190
 
191
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
192
-		$this->view->addHelper( 'param', $helper );
191
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
192
+		$this->view->addHelper('param', $helper);
193 193
 		$this->view->item = $item;
194 194
 
195 195
 		$result = $this->object->save();
196 196
 
197
-		$item = $manager->getItem( $item->getId(), ['product'] );
198
-		$manager->deleteItem( $item->getId() );
197
+		$item = $manager->getItem($item->getId(), ['product']);
198
+		$manager->deleteItem($item->getId());
199 199
 
200
-		$this->assertNull( $this->view->get( 'errors' ) );
201
-		$this->assertNull( $result );
202
-		$this->assertEquals( 1, count( $item->getListItems() ) );
200
+		$this->assertNull($this->view->get('errors'));
201
+		$this->assertNull($result);
202
+		$this->assertEquals(1, count($item->getListItems()));
203 203
 
204
-		foreach( $item->getListItems( 'product' ) as $listItem )
204
+		foreach ($item->getListItems('product') as $listItem)
205 205
 		{
206
-			$this->assertEquals( $item->getId(), $listItem->getParentId() );
207
-			$this->assertEquals( 'promotion', $listItem->getType() );
208
-			$this->assertEquals( 'product', $listItem->getDomain() );
209
-			$this->assertEquals( '2000-01-01 00:00:00', $listItem->getDateStart() );
210
-			$this->assertEquals( '2100-01-01 00:00:00', $listItem->getDateEnd() );
211
-			$this->assertEquals( ['test' => 'value'], $listItem->getConfig() );
212
-			$this->assertEquals( 'test', $listItem->getRefId() );
213
-			$this->assertEquals( 1, $listItem->getStatus() );
206
+			$this->assertEquals($item->getId(), $listItem->getParentId());
207
+			$this->assertEquals('promotion', $listItem->getType());
208
+			$this->assertEquals('product', $listItem->getDomain());
209
+			$this->assertEquals('2000-01-01 00:00:00', $listItem->getDateStart());
210
+			$this->assertEquals('2100-01-01 00:00:00', $listItem->getDateEnd());
211
+			$this->assertEquals(['test' => 'value'], $listItem->getConfig());
212
+			$this->assertEquals('test', $listItem->getRefId());
213
+			$this->assertEquals(1, $listItem->getStatus());
214 214
 		}
215 215
 	}
216 216
 
217 217
 
218 218
 	public function testSaveException()
219 219
 	{
220
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
221
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
222
-			->setMethods( array( 'fromArray' ) )
220
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
221
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
222
+			->setMethods(array('fromArray'))
223 223
 			->getMock();
224 224
 
225
-		$object->expects( $this->once() )->method( 'fromArray' )
226
-			->will( $this->throwException( new \RuntimeException() ) );
225
+		$object->expects($this->once())->method('fromArray')
226
+			->will($this->throwException(new \RuntimeException()));
227 227
 
228
-		$object->setView( $this->getViewNoRender() );
228
+		$object->setView($this->getViewNoRender());
229 229
 
230
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
230
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
231 231
 		$object->save();
232 232
 	}
233 233
 
234 234
 
235 235
 	public function testSaveMShopException()
236 236
 	{
237
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
238
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
239
-			->setMethods( array( 'fromArray' ) )
237
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
238
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
239
+			->setMethods(array('fromArray'))
240 240
 			->getMock();
241 241
 
242
-		$object->expects( $this->once() )->method( 'fromArray' )
243
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
242
+		$object->expects($this->once())->method('fromArray')
243
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
244 244
 
245
-		$object->setView( $this->getViewNoRender() );
245
+		$object->setView($this->getViewNoRender());
246 246
 
247
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
247
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
248 248
 		$object->save();
249 249
 	}
250 250
 
251 251
 
252 252
 	public function testGetSubClient()
253 253
 	{
254
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
255
-		$this->object->getSubClient( 'unknown' );
254
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
255
+		$this->object->getSubClient('unknown');
256 256
 	}
257 257
 
258 258
 
259 259
 	protected function getViewNoRender()
260 260
 	{
261
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
262
-			->setConstructorArgs( array( [] ) )
263
-			->setMethods( array( 'render', 'config' ) )
261
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
262
+			->setConstructorArgs(array([]))
263
+			->setMethods(array('render', 'config'))
264 264
 			->getMock();
265 265
 
266
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
267
-		$view->item = $manager->findItem( 'cafe' );
266
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
267
+		$view->item = $manager->findItem('cafe');
268 268
 
269 269
 		return $view;
270 270
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Catalog/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Catalog\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Catalog\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertNull( $this->view->get( 'errors' ) );
50
-		$this->assertContains( 'item-text', $result );
49
+		$this->assertNull($this->view->get('errors'));
50
+		$this->assertContains('item-text', $result);
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
57 57
 
58
-		$this->view->item = $manager->findItem( 'cafe', array( 'text' ) );
58
+		$this->view->item = $manager->findItem('cafe', array('text'));
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( 'item-text', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('item-text', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
81 81
 
82
-		$this->view->item = $manager->findItem( 'cafe', array( 'text' ) );
82
+		$this->view->item = $manager->findItem('cafe', array('text'));
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( 'item-text', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('item-text', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $this->view->item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($this->view->item->getListItems()));
131 131
 
132
-		foreach( $this->view->item->getListItems( 'text' ) as $listItem )
132
+		foreach ($this->view->item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Text\Standard::class )
145
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
146
-			->setMethods( array( 'fromArray' ) )
144
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Text\Standard::class)
145
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
146
+			->setMethods(array('fromArray'))
147 147
 			->getMock();
148 148
 
149
-		$object->expects( $this->once() )->method( 'fromArray' )
150
-			->will( $this->throwException( new \RuntimeException() ) );
149
+		$object->expects($this->once())->method('fromArray')
150
+			->will($this->throwException(new \RuntimeException()));
151 151
 
152 152
 		$this->view = \TestHelperJqadm::getView();
153
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
153
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
154 154
 
155
-		$object->setView( $this->view );
155
+		$object->setView($this->view);
156 156
 
157
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
157
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
158 158
 		$object->save();
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveMShopException()
163 163
 	{
164
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Text\Standard::class )
165
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
166
-			->setMethods( array( 'fromArray' ) )
164
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Text\Standard::class)
165
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
166
+			->setMethods(array('fromArray'))
167 167
 			->getMock();
168 168
 
169
-		$object->expects( $this->once() )->method( 'fromArray' )
170
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
169
+		$object->expects($this->once())->method('fromArray')
170
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
171 171
 
172 172
 		$this->view = \TestHelperJqadm::getView();
173
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
173
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
174 174
 
175
-		$object->setView( $this->view );
175
+		$object->setView($this->view);
176 176
 
177
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
177
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
178 178
 		$object->save();
179 179
 	}
180 180
 
181 181
 
182 182
 	public function testSearch()
183 183
 	{
184
-		$this->assertNull( $this->object->search() );
184
+		$this->assertNull($this->object->search());
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testGetSubClient()
189 189
 	{
190
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
191
-		$this->object->getSubClient( 'unknown' );
190
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
191
+		$this->object->getSubClient('unknown');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Service/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Service\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Service\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'service');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertContains( 'item-text', $result );
50
-		$this->assertNull( $this->view->get( 'errors' ) );
49
+		$this->assertContains('item-text', $result);
50
+		$this->assertNull($this->view->get('errors'));
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'service');
57 57
 
58
-		$this->view->item = $manager->findItem( 'unitcode', ['text'] );
58
+		$this->view->item = $manager->findItem('unitcode', ['text']);
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( 'Unittest service name', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('Unittest service name', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'service');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'service');
81 81
 
82
-		$this->view->item = $manager->findItem( 'unitcode', ['text'] );
82
+		$this->view->item = $manager->findItem('unitcode', ['text']);
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( 'Unittest service name', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('Unittest service name', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'service');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($item->getListItems()));
131 131
 
132
-		foreach( $item->getListItems( 'text' ) as $listItem )
132
+		foreach ($item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Text\Standard::class )
145
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
146
-			->setMethods( array( 'fromArray' ) )
144
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Text\Standard::class)
145
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
146
+			->setMethods(array('fromArray'))
147 147
 			->getMock();
148 148
 
149
-		$object->expects( $this->once() )->method( 'fromArray' )
150
-			->will( $this->throwException( new \RuntimeException() ) );
149
+		$object->expects($this->once())->method('fromArray')
150
+			->will($this->throwException(new \RuntimeException()));
151 151
 
152 152
 		$this->view = \TestHelperJqadm::getView();
153
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
153
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
154 154
 
155
-		$object->setView( $this->view );
155
+		$object->setView($this->view);
156 156
 
157
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
157
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
158 158
 		$object->save();
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveMShopException()
163 163
 	{
164
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Text\Standard::class )
165
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
166
-			->setMethods( array( 'fromArray' ) )
164
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Text\Standard::class)
165
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
166
+			->setMethods(array('fromArray'))
167 167
 			->getMock();
168 168
 
169
-		$object->expects( $this->once() )->method( 'fromArray' )
170
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
169
+		$object->expects($this->once())->method('fromArray')
170
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
171 171
 
172 172
 		$this->view = \TestHelperJqadm::getView();
173
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
173
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
174 174
 
175
-		$object->setView( $this->view );
175
+		$object->setView($this->view);
176 176
 
177
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
177
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
178 178
 		$object->save();
179 179
 	}
180 180
 
181 181
 
182 182
 	public function testSearch()
183 183
 	{
184
-		$this->assertNull( $this->object->search() );
184
+		$this->assertNull($this->object->search());
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testGetSubClient()
189 189
 	{
190
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
191
-		$this->object->getSubClient( 'unknown' );
190
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
191
+		$this->object->getSubClient('unknown');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Service/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\Service\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\Service\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, 'service' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'service');
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, 'service' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'service');
52 52
 
53
-		$this->view->item = $manager->findItem( 'unitcode', ['price'] );
53
+		$this->view->item = $manager->findItem('unitcode', ['price']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '&quot;price.type&quot;:&quot;default&quot;', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('&quot;price.type&quot;:&quot;default&quot;', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'service');
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, 'service' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'service');
76 76
 
77
-		$this->view->item = $manager->findItem( 'unitcode', ['price'] );
77
+		$this->view->item = $manager->findItem('unitcode', ['price']);
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '&quot;price.type&quot;:&quot;default&quot;', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('&quot;price.type&quot;:&quot;default&quot;', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'service');
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( '20.00', $refItem->getTaxRate() );
122
-			$this->assertEquals( '10.00', $refItem->getValue() );
123
-			$this->assertEquals( '5.00', $refItem->getRebate() );
124
-			$this->assertEquals( '1.00', $refItem->getCosts() );
125
-			$this->assertEquals( '2', $refItem->getQuantity() );
120
+			$this->assertEquals('EUR', $refItem->getCurrencyId());
121
+			$this->assertEquals('20.00', $refItem->getTaxRate());
122
+			$this->assertEquals('10.00', $refItem->getValue());
123
+			$this->assertEquals('5.00', $refItem->getRebate());
124
+			$this->assertEquals('1.00', $refItem->getCosts());
125
+			$this->assertEquals('2', $refItem->getQuantity());
126 126
 		}
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testSaveException()
131 131
 	{
132
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Price\Standard::class )
133
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
134
-			->setMethods( array( 'fromArray' ) )
132
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\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, 'service' )->createItem();
141
+		$view->item = \Aimeos\MShop::create($this->context, 'service')->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\Service\Price\Standard::class )
153
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
154
-			->setMethods( array( 'fromArray' ) )
152
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\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, 'service' )->createItem();
161
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->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/Customer/StandardTest.php 1 patch
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Customer\Standard( $this->context );
29
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
30
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
31
-		$this->object->setView( $this->view );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Customer\Standard($this->context);
29
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
30
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
31
+		$this->object->setView($this->view);
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->view, $this->context );
37
+		unset($this->object, $this->view, $this->context);
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function testCreateException()
48 48
 	{
49
-		$object = $this->getClientMock( 'getSubClients' );
49
+		$object = $this->getClientMock('getSubClients');
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \RuntimeException() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \RuntimeException()));
53 53
 
54 54
 		$object->create();
55 55
 	}
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function testCreateMShopException()
59 59
 	{
60
-		$object = $this->getClientMock( 'getSubClients' );
60
+		$object = $this->getClientMock('getSubClients');
61 61
 
62
-		$object->expects( $this->once() )->method( 'getSubClients' )
63
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
62
+		$object->expects($this->once())->method('getSubClients')
63
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
64 64
 
65 65
 		$object->create();
66 66
 	}
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 
69 69
 	public function testCopy()
70 70
 	{
71
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
71
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
72 72
 
73
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'UTC001' )->getId()];
74
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
75
-		$this->view->addHelper( 'param', $helper );
73
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('UTC001')->getId()];
74
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
75
+		$this->view->addHelper('param', $helper);
76 76
 
77 77
 		$result = $this->object->copy();
78 78
 
79
-		$this->assertContains( 'Example company', $result );
79
+		$this->assertContains('Example company', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testCopyException()
84 84
 	{
85
-		$object = $this->getClientMock( 'getSubClients' );
85
+		$object = $this->getClientMock('getSubClients');
86 86
 
87
-		$object->expects( $this->once() )->method( 'getSubClients' )
88
-			->will( $this->throwException( new \RuntimeException() ) );
87
+		$object->expects($this->once())->method('getSubClients')
88
+			->will($this->throwException(new \RuntimeException()));
89 89
 
90 90
 		$object->copy();
91 91
 	}
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 
94 94
 	public function testCopyMShopException()
95 95
 	{
96
-		$object = $this->getClientMock( 'getSubClients' );
96
+		$object = $this->getClientMock('getSubClients');
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testDelete()
106 106
 	{
107
-		$this->assertNotNull( $this->object->delete() );
107
+		$this->assertNotNull($this->object->delete());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testDeleteException()
112 112
 	{
113
-		$object = $this->getClientMock( 'getSubClients' );
113
+		$object = $this->getClientMock('getSubClients');
114 114
 
115
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
116
-			->will( $this->throwException( new \RuntimeException() ) );
115
+		$object->expects($this->exactly(2))->method('getSubClients')
116
+			->will($this->throwException(new \RuntimeException()));
117 117
 
118 118
 		$object->delete();
119 119
 	}
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDeleteMShopException()
123 123
 	{
124
-		$object = $this->getClientMock( 'getSubClients' );
124
+		$object = $this->getClientMock('getSubClients');
125 125
 
126
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
127
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
126
+		$object->expects($this->exactly(2))->method('getSubClients')
127
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
128 128
 
129 129
 		$object->delete();
130 130
 	}
@@ -132,24 +132,24 @@  discard block
 block discarded – undo
132 132
 
133 133
 	public function testGet()
134 134
 	{
135
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
135
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
136 136
 
137
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'UTC001' )->getId()];
138
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
139
-		$this->view->addHelper( 'param', $helper );
137
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('UTC001')->getId()];
138
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
139
+		$this->view->addHelper('param', $helper);
140 140
 
141 141
 		$result = $this->object->get();
142 142
 
143
-		$this->assertContains( 'unitCustomer001', $result );
143
+		$this->assertContains('unitCustomer001', $result);
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetException()
148 148
 	{
149
-		$object = $this->getClientMock( 'getSubClients' );
149
+		$object = $this->getClientMock('getSubClients');
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \RuntimeException() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \RuntimeException()));
153 153
 
154 154
 		$object->get();
155 155
 	}
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function testGetMShopException()
159 159
 	{
160
-		$object = $this->getClientMock( 'getSubClients' );
160
+		$object = $this->getClientMock('getSubClients');
161 161
 
162
-		$object->expects( $this->once() )->method( 'getSubClients' )
163
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
162
+		$object->expects($this->once())->method('getSubClients')
163
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
164 164
 
165 165
 		$object->get();
166 166
 	}
@@ -168,16 +168,16 @@  discard block
 block discarded – undo
168 168
 
169 169
 	public function testGetViewException()
170 170
 	{
171
-		$object = new \Aimeos\Admin\JQAdm\Customer\Standard( $this->context, [] );
171
+		$object = new \Aimeos\Admin\JQAdm\Customer\Standard($this->context, []);
172 172
 
173
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
180
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
181 181
 
182 182
 		$param = array(
183 183
 			'site' => 'unittest',
@@ -189,21 +189,21 @@  discard block
 block discarded – undo
189 189
 			),
190 190
 		);
191 191
 
192
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
193
-		$this->view->addHelper( 'param', $helper );
192
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
193
+		$this->view->addHelper('param', $helper);
194 194
 
195 195
 		$this->object->save();
196 196
 
197
-		$manager->deleteItem( $manager->findItem( 'jqadm@test' )->getId() );
197
+		$manager->deleteItem($manager->findItem('jqadm@test')->getId());
198 198
 	}
199 199
 
200 200
 
201 201
 	public function testSaveException()
202 202
 	{
203
-		$object = $this->getClientMock( 'fromArray' );
203
+		$object = $this->getClientMock('fromArray');
204 204
 
205
-		$object->expects( $this->once() )->method( 'fromArray' )
206
-			->will( $this->throwException( new \RuntimeException() ) );
205
+		$object->expects($this->once())->method('fromArray')
206
+			->will($this->throwException(new \RuntimeException()));
207 207
 
208 208
 		$object->save();
209 209
 	}
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
 
212 212
 	public function testSaveMShopException()
213 213
 	{
214
-		$object = $this->getClientMock( 'fromArray' );
214
+		$object = $this->getClientMock('fromArray');
215 215
 
216
-		$object->expects( $this->once() )->method( 'fromArray' )
217
-			->will( $this->throwException( new \RuntimeException() ) );
216
+		$object->expects($this->once())->method('fromArray')
217
+			->will($this->throwException(new \RuntimeException()));
218 218
 
219 219
 		$object->save();
220 220
 	}
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
 
223 223
 	public function testSaveJQAdmException()
224 224
 	{
225
-		$object = $this->getClientMock( 'fromArray' );
225
+		$object = $this->getClientMock('fromArray');
226 226
 
227
-		$object->expects( $this->once() )->method( 'fromArray' )
228
-			->will( $this->throwException( new \RuntimeException() ) );
227
+		$object->expects($this->once())->method('fromArray')
228
+			->will($this->throwException(new \RuntimeException()));
229 229
 
230 230
 		$object->save();
231 231
 	}
@@ -236,27 +236,27 @@  discard block
 block discarded – undo
236 236
 		$param = array(
237 237
 			'site' => 'unittest', 'lang' => 'de',
238 238
 			'filter' => array(
239
-				'key' => array( 0 => 'customer.code' ),
240
-				'op' => array( 0 => '==' ),
241
-				'val' => array( 0 => 'UTC001' ),
239
+				'key' => array(0 => 'customer.code'),
240
+				'op' => array(0 => '=='),
241
+				'val' => array(0 => 'UTC001'),
242 242
 			),
243
-			'sort' => array( 'customer.label', '-customer.id' ),
243
+			'sort' => array('customer.label', '-customer.id'),
244 244
 		);
245
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
246
-		$this->view->addHelper( 'param', $helper );
245
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
246
+		$this->view->addHelper('param', $helper);
247 247
 
248 248
 		$result = $this->object->search();
249 249
 
250
-		$this->assertContains( '>UTC001<', $result );
250
+		$this->assertContains('>UTC001<', $result);
251 251
 	}
252 252
 
253 253
 
254 254
 	public function testSearchException()
255 255
 	{
256
-		$object = $this->getClientMock( 'initCriteria' );
256
+		$object = $this->getClientMock('initCriteria');
257 257
 
258
-		$object->expects( $this->once() )->method( 'initCriteria' )
259
-			->will( $this->throwException( new \RuntimeException() ) );
258
+		$object->expects($this->once())->method('initCriteria')
259
+			->will($this->throwException(new \RuntimeException()));
260 260
 
261 261
 		$object->search();
262 262
 	}
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 
265 265
 	public function testSearchMShopException()
266 266
 	{
267
-		$object = $this->getClientMock( 'initCriteria' );
267
+		$object = $this->getClientMock('initCriteria');
268 268
 
269
-		$object->expects( $this->once() )->method( 'initCriteria' )
270
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
269
+		$object->expects($this->once())->method('initCriteria')
270
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
271 271
 
272 272
 		$object->search();
273 273
 	}
@@ -275,43 +275,43 @@  discard block
 block discarded – undo
275 275
 
276 276
 	public function testGetSubClient()
277 277
 	{
278
-		$result = $this->object->getSubClient( 'address' );
279
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
278
+		$result = $this->object->getSubClient('address');
279
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
280 280
 	}
281 281
 
282 282
 
283 283
 	public function testGetSubClientInvalid()
284 284
 	{
285
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
286
-		$this->object->getSubClient( '$unknown$' );
285
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
286
+		$this->object->getSubClient('$unknown$');
287 287
 	}
288 288
 
289 289
 
290 290
 	public function testGetSubClientUnknown()
291 291
 	{
292
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
293
-		$this->object->getSubClient( 'unknown' );
292
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
293
+		$this->object->getSubClient('unknown');
294 294
 	}
295 295
 
296 296
 
297 297
 	public function testGetSubClientDecoratorInvalid()
298 298
 	{
299
-		$this->context->getConfig()->set( 'admin/jqadm/customer/product/decorators/global', array( 'Invalid' ) );
299
+		$this->context->getConfig()->set('admin/jqadm/customer/product/decorators/global', array('Invalid'));
300 300
 
301
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
302
-		$this->object->getSubClient( 'product' );
301
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
302
+		$this->object->getSubClient('product');
303 303
 	}
304 304
 
305 305
 
306
-	public function getClientMock( $method )
306
+	public function getClientMock($method)
307 307
 	{
308
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Standard::class )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( [$method] )
308
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Standard::class)
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods([$method])
311 311
 			->getMock();
312 312
 
313
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
314
-		$object->setView( $this->getViewNoRender() );
313
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
314
+		$object->setView($this->getViewNoRender());
315 315
 
316 316
 		return $object;
317 317
 	}
@@ -319,19 +319,19 @@  discard block
 block discarded – undo
319 319
 
320 320
 	protected function getViewNoRender()
321 321
 	{
322
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
323
-			->setConstructorArgs( array( [] ) )
324
-			->setMethods( array( 'render', 'config' ) )
322
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
323
+			->setConstructorArgs(array([]))
324
+			->setMethods(array('render', 'config'))
325 325
 			->getMock();
326 326
 
327
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
327
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
328 328
 
329
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'UTC001' )->getId()];
330
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
331
-		$view->addHelper( 'param', $helper );
329
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('UTC001')->getId()];
330
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
331
+		$view->addHelper('param', $helper);
332 332
 
333
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
334
-		$view->addHelper( 'access', $helper );
333
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
334
+		$view->addHelper('access', $helper);
335 335
 
336 336
 		return $view;
337 337
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Customer/Address/StandardTest.php 1 patch
Spacing   +47 added lines, -47 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\Customer\Address\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\Customer\Address\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, 'customer' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-address', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-address', $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, 'customer' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
52 52
 
53
-		$this->view->item = $manager->findItem( 'UTC001', array( 'customer/address' ) );
53
+		$this->view->item = $manager->findItem('UTC001', array('customer/address'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Example company', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Example company', $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, 'customer' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
73 73
 
74
-		$this->view->item = $manager->findItem( 'UTC001', array( 'customer/address' ) );
74
+		$this->view->item = $manager->findItem('UTC001', array('customer/address'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Example company', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Example company', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -96,73 +96,73 @@  discard block
 block discarded – undo
96 96
 			),
97 97
 		);
98 98
 
99
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
100
-		$this->view->addHelper( 'param', $helper );
99
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
100
+		$this->view->addHelper('param', $helper);
101 101
 
102 102
 		$result = $this->object->save();
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $this->view->item->getAddressItems() ) );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($this->view->item->getAddressItems()));
107 107
 
108
-		foreach( $this->view->item->getAddressItems() as $addrItem )
108
+		foreach ($this->view->item->getAddressItems() as $addrItem)
109 109
 		{
110
-			$this->assertEquals( '[email protected]', $addrItem->getEmail() );
111
-			$this->assertEquals( 'test', $addrItem->getFirstname() );
112
-			$this->assertEquals( 'user', $addrItem->getLastname() );
110
+			$this->assertEquals('[email protected]', $addrItem->getEmail());
111
+			$this->assertEquals('test', $addrItem->getFirstname());
112
+			$this->assertEquals('user', $addrItem->getLastname());
113 113
 		}
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testSaveException()
118 118
 	{
119
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Address\Standard::class )
120
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
121
-			->setMethods( array( 'fromArray' ) )
119
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Address\Standard::class)
120
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
121
+			->setMethods(array('fromArray'))
122 122
 			->getMock();
123 123
 
124
-		$object->expects( $this->once() )->method( 'fromArray' )
125
-			->will( $this->throwException( new \RuntimeException() ) );
124
+		$object->expects($this->once())->method('fromArray')
125
+			->will($this->throwException(new \RuntimeException()));
126 126
 
127 127
 		$view = \TestHelperJqadm::getView();
128
-		$view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
128
+		$view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
129 129
 
130
-		$object->setView( $view );
130
+		$object->setView($view);
131 131
 
132
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
132
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
133 133
 		$object->save();
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testSaveMShopException()
138 138
 	{
139
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Address\Standard::class )
140
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
141
-			->setMethods( array( 'fromArray' ) )
139
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Address\Standard::class)
140
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
141
+			->setMethods(array('fromArray'))
142 142
 			->getMock();
143 143
 
144
-		$object->expects( $this->once() )->method( 'fromArray' )
145
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
144
+		$object->expects($this->once())->method('fromArray')
145
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
146 146
 
147 147
 		$this->view = \TestHelperJqadm::getView();
148
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
148
+		$this->view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
149 149
 
150
-		$object->setView( $this->view );
150
+		$object->setView($this->view);
151 151
 
152
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
152
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
153 153
 		$object->save();
154 154
 	}
155 155
 
156 156
 
157 157
 	public function testSearch()
158 158
 	{
159
-		$this->assertNull( $this->object->search() );
159
+		$this->assertNull($this->object->search());
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testGetSubClient()
164 164
 	{
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
166
-		$this->object->getSubClient( 'unknown' );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166
+		$this->object->getSubClient('unknown');
167 167
 	}
168 168
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Customer/Order/StandardTest.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -21,66 +21,66 @@  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\Customer\Order\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\Customer\Order\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 testCopy()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
40
-		$this->view->item = $manager->findItem( 'UTC001' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
40
+		$this->view->item = $manager->findItem('UTC001');
41 41
 
42 42
 		$result = $this->object->copy();
43 43
 
44
-		$this->assertContains( 'item-order', $result );
45
-		$this->assertContains( '4800.00', $result );
44
+		$this->assertContains('item-order', $result);
45
+		$this->assertContains('4800.00', $result);
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCreate()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
52
-		$this->view->item = $manager->findItem( 'UTC001' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
52
+		$this->view->item = $manager->findItem('UTC001');
53 53
 
54 54
 		$result = $this->object->create();
55 55
 
56
-		$this->assertContains( 'item-order', $result );
57
-		$this->assertContains( '4800.00', $result );
56
+		$this->assertContains('item-order', $result);
57
+		$this->assertContains('4800.00', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testGet()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
64
-		$this->view->item = $manager->findItem( 'UTC001' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
64
+		$this->view->item = $manager->findItem('UTC001');
65 65
 
66 66
 		$result = $this->object->get();
67 67
 
68
-		$this->assertContains( 'item-order', $result );
69
-		$this->assertContains( '4800.00', $result );
68
+		$this->assertContains('item-order', $result);
69
+		$this->assertContains('4800.00', $result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGetException()
74 74
 	{
75
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Order\Standard::class )
76
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
77
-			->setMethods( array( 'storeSearchParams' ) )
75
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Order\Standard::class)
76
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
77
+			->setMethods(array('storeSearchParams'))
78 78
 			->getMock();
79 79
 
80
-		$object->expects( $this->once() )->method( 'storeSearchParams' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('storeSearchParams')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83
-		$object->setView( $this->getViewNoRender() );
83
+		$object->setView($this->getViewNoRender());
84 84
 
85 85
 		$object->get();
86 86
 	}
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 
89 89
 	public function testGetMShopException()
90 90
 	{
91
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Order\Standard::class )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'storeSearchParams' ) )
91
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Order\Standard::class)
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('storeSearchParams'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'storeSearchParams' )
97
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
96
+		$object->expects($this->once())->method('storeSearchParams')
97
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->get();
102 102
 	}
@@ -104,28 +104,28 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testSave()
106 106
 	{
107
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
108
-		$this->view->item = $manager->findItem( 'UTC001' );
107
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
108
+		$this->view->item = $manager->findItem('UTC001');
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112
-		$this->assertContains( 'item-order', $result );
113
-		$this->assertContains( '4800.00', $result );
112
+		$this->assertContains('item-order', $result);
113
+		$this->assertContains('4800.00', $result);
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 
123 123
 
124 124
 	protected function getViewNoRender()
125 125
 	{
126
-		return $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
127
-			->setConstructorArgs( array( [] ) )
128
-			->setMethods( array( 'render', 'config' ) )
126
+		return $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
127
+			->setConstructorArgs(array([]))
128
+			->setMethods(array('render', 'config'))
129 129
 			->getMock();
130 130
 	}
131 131
 }
Please login to merge, or discard this patch.