Completed
Push — master ( b686ff...f6a1d0 )
by Aimeos
02:01
created
Tests/Controller/CatalogControllerTest.php 1 patch
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -10,290 +10,290 @@
 block discarded – undo
10 10
 {
11 11
 	protected function setUp()
12 12
 	{
13
-		\Aimeos\MShop::cache( false );
14
-		\Aimeos\Controller\Frontend::cache( false );
13
+		\Aimeos\MShop::cache(false);
14
+		\Aimeos\Controller\Frontend::cache(false);
15 15
 	}
16 16
 
17 17
 
18 18
 	public function testCount()
19 19
 	{
20 20
 		$client = static::createClient();
21
-		$client->request( 'GET', '/unittest/de/EUR/count' );
21
+		$client->request('GET', '/unittest/de/EUR/count');
22 22
 		$content = $client->getResponse()->getContent();
23 23
 
24
-		$this->assertContains( '".catalog-filter-count li.cat-item"', $content );
25
-		$this->assertContains( '".catalog-filter-attribute .attribute-lists li.attr-item"', $content );
24
+		$this->assertContains('".catalog-filter-count li.cat-item"', $content);
25
+		$this->assertContains('".catalog-filter-attribute .attribute-lists li.attr-item"', $content);
26 26
 	}
27 27
 
28 28
 
29 29
 	public function testFilterSearch()
30 30
 	{
31 31
 		$client = static::createClient();
32
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
32
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
33 33
 
34
-		$this->assertEquals( 1, $crawler->filter( '.catalog-filter-search' )->count() );
34
+		$this->assertEquals(1, $crawler->filter('.catalog-filter-search')->count());
35 35
 
36
-		$form = $crawler->filter( '.catalog-filter-search button' )->form();
36
+		$form = $crawler->filter('.catalog-filter-search button')->form();
37 37
 		$form['f_search'] = 'Cafe';
38
-		$crawler = $client->submit( $form );
38
+		$crawler = $client->submit($form);
39 39
 
40
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->count() );
40
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->count());
41 41
 	}
42 42
 
43 43
 
44 44
  	public function testFilterTree()
45 45
 	{
46 46
 		$client = static::createClient();
47
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
47
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
48 48
 
49
-		$this->assertEquals( 1, $crawler->filter( '.catalog-filter-tree' )->count() );
49
+		$this->assertEquals(1, $crawler->filter('.catalog-filter-tree')->count());
50 50
 
51
-		$link = $crawler->filter( '.catalog-filter-tree a.cat-item' )->link();
52
-		$crawler = $client->click( $link );
51
+		$link = $crawler->filter('.catalog-filter-tree a.cat-item')->link();
52
+		$crawler = $client->click($link);
53 53
 
54
-		$link = $crawler->filter( '.catalog-filter-tree .categories a.cat-item' )->link();
55
-		$crawler = $client->click( $link );
54
+		$link = $crawler->filter('.catalog-filter-tree .categories a.cat-item')->link();
55
+		$crawler = $client->click($link);
56 56
 
57
-		$link = $crawler->filter( '.catalog-filter-tree .coffee a.cat-item' )->link();
58
-		$crawler = $client->click( $link );
57
+		$link = $crawler->filter('.catalog-filter-tree .coffee a.cat-item')->link();
58
+		$crawler = $client->click($link);
59 59
 
60
-		$this->assertEquals( 3, $crawler->filter( '.catalog-stage-breadcrumb li' )->count() );
61
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->count() );
60
+		$this->assertEquals(3, $crawler->filter('.catalog-stage-breadcrumb li')->count());
61
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->count());
62 62
 	}
63 63
 
64 64
 
65 65
 	public function testFilterAttribute()
66 66
 	{
67 67
 		$client = static::createClient();
68
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
68
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
69 69
 
70
-		$this->assertEquals( 1, $crawler->filter( '.catalog-filter-attribute' )->count() );
70
+		$this->assertEquals(1, $crawler->filter('.catalog-filter-attribute')->count());
71 71
 
72
-		$nodes = $crawler->filter( '.catalog-filter-attribute .attr-size span:contains("XS")' );
73
-		$id = $nodes->parents()->filter( '.attr-item' )->attr( 'data-id');
72
+		$nodes = $crawler->filter('.catalog-filter-attribute .attr-size span:contains("XS")');
73
+		$id = $nodes->parents()->filter('.attr-item')->attr('data-id');
74 74
 
75
-		$form = $crawler->filter( '.catalog-filter .btn-primary' )->form();
75
+		$form = $crawler->filter('.catalog-filter .btn-primary')->form();
76 76
 		$values = $form->getPhpValues();
77
-		$values['f_attrid'] = array( $id );
78
-		$crawler = $client->request( $form->getMethod(), $form->getUri(), $values, $form->getPhpFiles() );
77
+		$values['f_attrid'] = array($id);
78
+		$crawler = $client->request($form->getMethod(), $form->getUri(), $values, $form->getPhpFiles());
79 79
 
80
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->count() );
81
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Cappuccino")' )->count() );
80
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->count());
81
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Cappuccino")')->count());
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testStageBreadcrumb()
86 86
 	{
87 87
 		$client = static::createClient();
88
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
88
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
89 89
 
90
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link();
91
-		$crawler = $client->click( $link );
90
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link();
91
+		$crawler = $client->click($link);
92 92
 
93
-		$this->assertEquals( 1, $crawler->filter( '.catalog-stage-breadcrumb li' )->count() );
93
+		$this->assertEquals(1, $crawler->filter('.catalog-stage-breadcrumb li')->count());
94 94
 
95
-		$link = $crawler->filter( '.catalog-stage-breadcrumb a' )->link();
96
-		$crawler = $client->click( $link );
95
+		$link = $crawler->filter('.catalog-stage-breadcrumb a')->link();
96
+		$crawler = $client->click($link);
97 97
 
98
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list' )->count() );
99
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->count() );
100
-		$this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Cappuccino")' )->count() );
98
+		$this->assertEquals(1, $crawler->filter('.catalog-list')->count());
99
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->count());
100
+		$this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Cappuccino")')->count());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testStageNavigator()
105 105
 	{
106 106
 		$client = static::createClient();
107
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
107
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
108 108
 
109
-		$link = $crawler->filter( '.catalog-list .pagination .option-name' )->link();
110
-		$crawler = $client->click( $link );
109
+		$link = $crawler->filter('.catalog-list .pagination .option-name')->link();
110
+		$crawler = $client->click($link);
111 111
 
112
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Cappuccino")' )->link();
113
-		$crawler = $client->click( $link );
112
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Cappuccino")')->link();
113
+		$crawler = $client->click($link);
114 114
 
115
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() );
116
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Cafe Noire Cappuccino")' )->count() );
115
+		$this->assertEquals(1, $crawler->filter('.catalog-detail')->count());
116
+		$this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Cafe Noire Cappuccino")')->count());
117 117
 
118
-		$link = $crawler->filter( '.catalog-stage-navigator a.next' )->link();
119
-		$crawler = $client->click( $link );
118
+		$link = $crawler->filter('.catalog-stage-navigator a.next')->link();
119
+		$crawler = $client->click($link);
120 120
 
121
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() );
122
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Cafe Noire Expresso")' )->count() );
121
+		$this->assertEquals(1, $crawler->filter('.catalog-detail')->count());
122
+		$this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Cafe Noire Expresso")')->count());
123 123
 
124
-		$link = $crawler->filter( '.catalog-stage-navigator a.prev' )->link();
125
-		$crawler = $client->click( $link );
124
+		$link = $crawler->filter('.catalog-stage-navigator a.prev')->link();
125
+		$crawler = $client->click($link);
126 126
 
127
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() );
128
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Cafe Noire Cappuccino")' )->count() );
127
+		$this->assertEquals(1, $crawler->filter('.catalog-detail')->count());
128
+		$this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Cafe Noire Cappuccino")')->count());
129 129
 	}
130 130
 
131 131
 
132 132
 	public function testListSortationName()
133 133
 	{
134 134
 		$client = static::createClient();
135
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
135
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
136 136
 
137
-		$link = $crawler->filter( '.catalog-list .pagination .option-name' )->link();
138
-		$crawler = $client->click( $link );
137
+		$link = $crawler->filter('.catalog-list .pagination .option-name')->link();
138
+		$crawler = $client->click($link);
139 139
 
140
-		$products = $crawler->filter( '.catalog-list-items .product' );
141
-		$this->assertEquals( 1, $products->eq( 0 )->filter( 'h2:contains("Cafe Noire Cappuccino")' )->count() );
142
-		$this->assertEquals( 1, $products->eq( 1 )->filter( 'h2:contains("Cafe Noire Expresso")' )->count() );
143
-		$this->assertEquals( 1, $products->eq( 2 )->filter( 'h2:contains("Unittest: Bundle")' )->count() );
144
-		$this->assertEquals( 1, $products->eq( 3 )->filter( 'h2:contains("Unterproduct 3")' )->count() );
140
+		$products = $crawler->filter('.catalog-list-items .product');
141
+		$this->assertEquals(1, $products->eq(0)->filter('h2:contains("Cafe Noire Cappuccino")')->count());
142
+		$this->assertEquals(1, $products->eq(1)->filter('h2:contains("Cafe Noire Expresso")')->count());
143
+		$this->assertEquals(1, $products->eq(2)->filter('h2:contains("Unittest: Bundle")')->count());
144
+		$this->assertEquals(1, $products->eq(3)->filter('h2:contains("Unterproduct 3")')->count());
145 145
 
146
-		$link = $crawler->filter( '.catalog-list .pagination .option-name' )->link();
147
-		$crawler = $client->click( $link );
146
+		$link = $crawler->filter('.catalog-list .pagination .option-name')->link();
147
+		$crawler = $client->click($link);
148 148
 
149
-		$products = $crawler->filter( '.catalog-list-items .product' );
149
+		$products = $crawler->filter('.catalog-list-items .product');
150 150
 
151
-		$this->assertGreaterThan( 3, $products->count() );
152
-		$this->assertEquals( 1, $products->eq( 0 )->filter( 'h2:contains("Unterproduct 3")' )->count() );
153
-		$this->assertEquals( 1, $products->eq( 1 )->filter( 'h2:contains("Unittest: Bundle")' )->count() );
154
-		$this->assertEquals( 1, $products->eq( 2 )->filter( 'h2:contains("Cafe Noire Expresso")' )->count() );
155
-		$this->assertEquals( 1, $products->eq( 3 )->filter( 'h2:contains("Cafe Noire Cappuccino")' )->count() );
151
+		$this->assertGreaterThan(3, $products->count());
152
+		$this->assertEquals(1, $products->eq(0)->filter('h2:contains("Unterproduct 3")')->count());
153
+		$this->assertEquals(1, $products->eq(1)->filter('h2:contains("Unittest: Bundle")')->count());
154
+		$this->assertEquals(1, $products->eq(2)->filter('h2:contains("Cafe Noire Expresso")')->count());
155
+		$this->assertEquals(1, $products->eq(3)->filter('h2:contains("Cafe Noire Cappuccino")')->count());
156 156
 	}
157 157
 
158 158
 
159 159
 	public function testListSortationPrice()
160 160
 	{
161 161
 		$client = static::createClient();
162
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
162
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
163 163
 
164
-		$link = $crawler->filter( '.catalog-list .pagination .option-price' )->link();
165
-		$crawler = $client->click( $link );
164
+		$link = $crawler->filter('.catalog-list .pagination .option-price')->link();
165
+		$crawler = $client->click($link);
166 166
 
167
-		$products = $crawler->filter( '.catalog-list-items .product' );
167
+		$products = $crawler->filter('.catalog-list-items .product');
168 168
 		$count = $products->count();
169 169
 
170
-		$this->assertGreaterThan( 2, $count );
171
-		$this->assertEquals( 1, $products->eq( $count - 2 )->filter( '.value:contains("600.00 €")' )->count() );
172
-		$this->assertEquals( 1, $products->eq( $count - 1 )->filter( '.value:contains("600.00 €")' )->count() );
170
+		$this->assertGreaterThan(2, $count);
171
+		$this->assertEquals(1, $products->eq($count - 2)->filter('.value:contains("600.00 €")')->count());
172
+		$this->assertEquals(1, $products->eq($count - 1)->filter('.value:contains("600.00 €")')->count());
173 173
 
174
-		$link = $crawler->filter( '.catalog-list .pagination .option-price' )->link();
175
-		$crawler = $client->click( $link );
174
+		$link = $crawler->filter('.catalog-list .pagination .option-price')->link();
175
+		$crawler = $client->click($link);
176 176
 
177
-		$products = $crawler->filter( '.catalog-list-items .product' );
178
-		$this->assertEquals( 1, $products->eq( 0 )->filter( '.value:contains("600.00 €")' )->count() );
179
-		$this->assertEquals( 1, $products->eq( 1 )->filter( '.value:contains("600.00 €")' )->count() );
177
+		$products = $crawler->filter('.catalog-list-items .product');
178
+		$this->assertEquals(1, $products->eq(0)->filter('.value:contains("600.00 €")')->count());
179
+		$this->assertEquals(1, $products->eq(1)->filter('.value:contains("600.00 €")')->count());
180 180
 	}
181 181
 
182 182
 
183 183
 	public function testDetailPinned()
184 184
 	{
185 185
 		$client = static::createClient();
186
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
186
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
187 187
 
188
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link();
189
-		$crawler = $client->click( $link );
188
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link();
189
+		$crawler = $client->click($link);
190 190
 
191
-		$link = $crawler->filter( '.catalog-detail a.actions-button-pin' )->link();
192
-		$crawler = $client->click( $link );
191
+		$link = $crawler->filter('.catalog-detail a.actions-button-pin')->link();
192
+		$crawler = $client->click($link);
193 193
 
194
-		$this->assertEquals( 1, $crawler->filter( '.catalog-session-pinned .pinned-item' )->count() );
194
+		$this->assertEquals(1, $crawler->filter('.catalog-session-pinned .pinned-item')->count());
195 195
 	}
196 196
 
197 197
 
198 198
 	public function testDetailLastSeen()
199 199
 	{
200 200
 		$client = static::createClient();
201
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
201
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
202 202
 
203
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link();
204
-		$crawler = $client->click( $link );
203
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link();
204
+		$crawler = $client->click($link);
205 205
 
206
-		$this->assertEquals( 1, $crawler->filter( '.catalog-session-seen .seen-item' )->count() );
206
+		$this->assertEquals(1, $crawler->filter('.catalog-session-seen .seen-item')->count());
207 207
 	}
208 208
 
209 209
 
210 210
 	public function testSuggest()
211 211
 	{
212 212
 		$client = static::createClient();
213
-		$client->request( 'GET', '/unittest/de/EUR/suggest', array( 'f_search' => 'Cafe' ) );
213
+		$client->request('GET', '/unittest/de/EUR/suggest', array('f_search' => 'Cafe'));
214 214
 		$content = $client->getResponse()->getContent();
215 215
 
216
-		$this->assertStringStartsWith( '[{', $content );
216
+		$this->assertStringStartsWith('[{', $content);
217 217
 	}
218 218
 
219 219
 
220 220
 	public function testStock()
221 221
 	{
222 222
 		$client = static::createClient();
223
-		$client->request( 'GET', '/unittest/de/EUR/stock' );
223
+		$client->request('GET', '/unittest/de/EUR/stock');
224 224
 		$content = $client->getResponse()->getContent();
225 225
 
226
-		$this->assertContains( '.aimeos .product .stock', $content );
227
-		$this->assertContains( '.aimeos .catalog-detail-basket', $content );
226
+		$this->assertContains('.aimeos .product .stock', $content);
227
+		$this->assertContains('.aimeos .catalog-detail-basket', $content);
228 228
 	}
229 229
 
230 230
 
231 231
 	public function testCountComponent()
232 232
 	{
233 233
 		$client = static::createClient();
234
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogcountcomponent' );
234
+		$client->request('GET', '/unittest/de/EUR/test/catalogcountcomponent');
235 235
 
236
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
237
-		$this->assertContains( 'catalog-filter-count', $client->getResponse()->getContent() );
236
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
237
+		$this->assertContains('catalog-filter-count', $client->getResponse()->getContent());
238 238
 	}
239 239
 
240 240
 
241 241
 	public function testDetailComponent()
242 242
 	{
243 243
 		$client = static::createClient();
244
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogdetailcomponent' );
244
+		$client->request('GET', '/unittest/de/EUR/test/catalogdetailcomponent');
245 245
 
246
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
247
-		$this->assertContains( 'aimeos catalog-detail', $client->getResponse()->getContent() );
246
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
247
+		$this->assertContains('aimeos catalog-detail', $client->getResponse()->getContent());
248 248
 	}
249 249
 
250 250
 
251 251
 	public function testFilterComponent()
252 252
 	{
253 253
 		$client = static::createClient();
254
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogfiltercomponent' );
254
+		$client->request('GET', '/unittest/de/EUR/test/catalogfiltercomponent');
255 255
 
256
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
257
-		$this->assertContains( 'aimeos catalog-filter', $client->getResponse()->getContent() );
256
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
257
+		$this->assertContains('aimeos catalog-filter', $client->getResponse()->getContent());
258 258
 	}
259 259
 
260 260
 
261 261
 	public function testListComponent()
262 262
 	{
263 263
 		$client = static::createClient();
264
-		$client->request( 'GET', '/unittest/de/EUR/test/cataloglistcomponent' );
264
+		$client->request('GET', '/unittest/de/EUR/test/cataloglistcomponent');
265 265
 
266
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
267
-		$this->assertContains( 'aimeos catalog-list', $client->getResponse()->getContent() );
266
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
267
+		$this->assertContains('aimeos catalog-list', $client->getResponse()->getContent());
268 268
 	}
269 269
 
270 270
 
271 271
 	public function testSessionComponent()
272 272
 	{
273 273
 		$client = static::createClient();
274
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogsessioncomponent' );
274
+		$client->request('GET', '/unittest/de/EUR/test/catalogsessioncomponent');
275 275
 
276
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
277
-		$this->assertContains( 'aimeos catalog-session', $client->getResponse()->getContent() );
276
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
277
+		$this->assertContains('aimeos catalog-session', $client->getResponse()->getContent());
278 278
 	}
279 279
 
280 280
 
281 281
 	public function testStageComponent()
282 282
 	{
283 283
 		$client = static::createClient();
284
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogstagecomponent' );
284
+		$client->request('GET', '/unittest/de/EUR/test/catalogstagecomponent');
285 285
 
286
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
287
-		$this->assertContains( 'aimeos catalog-stage', $client->getResponse()->getContent() );
286
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
287
+		$this->assertContains('aimeos catalog-stage', $client->getResponse()->getContent());
288 288
 	}
289 289
 
290 290
 
291 291
 	public function testStockComponent()
292 292
 	{
293 293
 		$client = static::createClient();
294
-		$client->request( 'GET', '/unittest/de/EUR/test/catalogstockcomponent' );
294
+		$client->request('GET', '/unittest/de/EUR/test/catalogstockcomponent');
295 295
 
296
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
297
-		$this->assertContains( 'stock-list', $client->getResponse()->getContent() );
296
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
297
+		$this->assertContains('stock-list', $client->getResponse()->getContent());
298 298
 	}
299 299
 }
Please login to merge, or discard this patch.
Tests/Controller/CheckoutControllerTest.php 1 patch
Spacing   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 {
11 11
 	protected function setUp()
12 12
 	{
13
-		\Aimeos\MShop::cache( false );
14
-		\Aimeos\Controller\Frontend::cache( false );
13
+		\Aimeos\MShop::cache(false);
14
+		\Aimeos\Controller\Frontend::cache(false);
15 15
 	}
16 16
 
17 17
 
@@ -20,66 +20,66 @@  discard block
 block discarded – undo
20 20
 		$client = static::createClient(array(), array(
21 21
 			'PHP_AUTH_USER' => 'UTC001',
22 22
 			'PHP_AUTH_PW'   => 'unittest',
23
-		) );
23
+		));
24 24
 
25
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
25
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
26 26
 
27
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
28
-		$crawler = $client->click( $link );
27
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
28
+		$crawler = $client->click($link);
29 29
 
30
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
31
-		$crawler = $client->submit( $form );
30
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
31
+		$crawler = $client->submit($form);
32 32
 
33
-		$link = $crawler->filter( '.basket-standard .btn-action' )->link();
34
-		$crawler = $client->click( $link );
33
+		$link = $crawler->filter('.basket-standard .btn-action')->link();
34
+		$crawler = $client->click($link);
35 35
 
36
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Adresse")' )->count() );
37
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() );
38
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .address a' )->count() );
39
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() );
40
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() );
41
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() );
36
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Adresse")')->count());
37
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
38
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .address a')->count());
39
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count());
40
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
41
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
42 42
 
43 43
 
44
-		$form = $crawler->filter( '.checkout-standard form' )->form();
45
-		$form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) );
46
-		$crawler = $client->submit( $form );
44
+		$form = $crawler->filter('.checkout-standard form')->form();
45
+		$form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value'));
46
+		$crawler = $client->submit($form);
47 47
 
48
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() );
49
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() );
50
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Versand")' )->count() );
51
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() );
52
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() );
53
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() );
48
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
49
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
50
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Versand")')->count());
51
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .delivery a')->count());
52
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
53
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
54 54
 
55 55
 
56
-		$form = $crawler->filter( '.checkout-standard form' )->form();
57
-		$form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) );
58
-		$crawler = $client->submit( $form );
56
+		$form = $crawler->filter('.checkout-standard form')->form();
57
+		$form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value'));
58
+		$crawler = $client->submit($form);
59 59
 
60
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() );
61
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() );
62
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() );
63
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Zahlung")' )->count() );
64
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .payment a' )->count() );
65
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() );
60
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
61
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
62
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count());
63
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Zahlung")')->count());
64
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .payment a')->count());
65
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
66 66
 
67 67
 
68
-		$form = $crawler->filter( '.checkout-standard form' )->form();
69
-		$form['c_paymentoption']->select( $crawler->filter( '.checkout-standard-payment .item-service input' )->attr( 'value' ) );
70
-		$crawler = $client->submit( $form );
68
+		$form = $crawler->filter('.checkout-standard form')->form();
69
+		$form['c_paymentoption']->select($crawler->filter('.checkout-standard-payment .item-service input')->attr('value'));
70
+		$crawler = $client->submit($form);
71 71
 
72
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .basket a' )->count() );
73
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .address a' )->count() );
74
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .delivery a' )->count() );
75
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .payment a' )->count() );
76
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard .steps .current:contains("Übersicht")' )->count() );
77
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps .summary a' )->count() );
72
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .basket a')->count());
73
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .address a')->count());
74
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .delivery a')->count());
75
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .payment a')->count());
76
+		$this->assertEquals(1, $crawler->filter('.checkout-standard .steps .current:contains("Übersicht")')->count());
77
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps .summary a')->count());
78 78
 
79 79
 
80
-		$link = $crawler->filter( '.checkout-standard .steps .basket a' )->link();
81
-		$crawler = $client->click( $link );
82
-		$this->assertEquals( 0, $crawler->filter( '.checkout-standard .steps' )->count() );
80
+		$link = $crawler->filter('.checkout-standard .steps .basket a')->link();
81
+		$crawler = $client->click($link);
82
+		$this->assertEquals(0, $crawler->filter('.checkout-standard .steps')->count());
83 83
 	}
84 84
 
85 85
 
@@ -88,47 +88,47 @@  discard block
 block discarded – undo
88 88
 		$client = static::createClient(array(), array(
89 89
 			'PHP_AUTH_USER' => 'UTC001',
90 90
 			'PHP_AUTH_PW'   => 'unittest',
91
-		) );
91
+		));
92 92
 
93
-		$crawler = $this->_goToSummary( $client );
93
+		$crawler = $this->_goToSummary($client);
94 94
 
95
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
95
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
96 96
 
97 97
 
98
-		$link = $crawler->filter( '.checkout-standard .btn-back' )->link();
99
-		$crawler = $client->click( $link );
98
+		$link = $crawler->filter('.checkout-standard .btn-back')->link();
99
+		$crawler = $client->click($link);
100 100
 
101
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() );
101
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count());
102 102
 
103 103
 
104
-		$link = $crawler->filter( '.checkout-standard .btn-back' )->link();
105
-		$crawler = $client->click( $link );
104
+		$link = $crawler->filter('.checkout-standard .btn-back')->link();
105
+		$crawler = $client->click($link);
106 106
 
107
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() );
107
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count());
108 108
 
109 109
 
110
-		$link = $crawler->filter( '.checkout-standard .btn-back' )->link();
111
-		$crawler = $client->click( $link );
110
+		$link = $crawler->filter('.checkout-standard .btn-back')->link();
111
+		$crawler = $client->click($link);
112 112
 
113
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() );
113
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count());
114 114
 
115 115
 
116
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
117
-		$crawler = $client->submit( $form );
116
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
117
+		$crawler = $client->submit($form);
118 118
 
119
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() );
119
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count());
120 120
 
121 121
 
122
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
123
-		$crawler = $client->submit( $form );
122
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
123
+		$crawler = $client->submit($form);
124 124
 
125
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() );
125
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count());
126 126
 
127 127
 
128
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
129
-		$crawler = $client->submit( $form );
128
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
129
+		$crawler = $client->submit($form);
130 130
 
131
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
131
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
132 132
 	}
133 133
 
134 134
 
@@ -137,17 +137,17 @@  discard block
 block discarded – undo
137 137
 		$client = static::createClient(array(), array(
138 138
 			'PHP_AUTH_USER' => 'UTC001',
139 139
 			'PHP_AUTH_PW'   => 'unittest',
140
-		) );
140
+		));
141 141
 
142
-		$crawler = $this->_goToSummary( $client );
142
+		$crawler = $this->_goToSummary($client);
143 143
 
144
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
144
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
145 145
 
146 146
 
147
-		$link = $crawler->filter( '.checkout-standard .common-summary-address .payment .modify' )->link();
148
-		$crawler = $client->click( $link );
147
+		$link = $crawler->filter('.checkout-standard .common-summary-address .payment .modify')->link();
148
+		$crawler = $client->click($link);
149 149
 
150
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() );
150
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count());
151 151
 	}
152 152
 
153 153
 
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 		$client = static::createClient(array(), array(
157 157
 			'PHP_AUTH_USER' => 'UTC001',
158 158
 			'PHP_AUTH_PW'   => 'unittest',
159
-		) );
159
+		));
160 160
 
161
-		$crawler = $this->_goToSummary( $client );
161
+		$crawler = $this->_goToSummary($client);
162 162
 
163
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
163
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
164 164
 
165 165
 
166
-		$link = $crawler->filter( '.checkout-standard .common-summary-address .delivery .modify' )->link();
167
-		$crawler = $client->click( $link );
166
+		$link = $crawler->filter('.checkout-standard .common-summary-address .delivery .modify')->link();
167
+		$crawler = $client->click($link);
168 168
 
169
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-address' )->count() );
169
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-address')->count());
170 170
 	}
171 171
 
172 172
 
@@ -175,17 +175,17 @@  discard block
 block discarded – undo
175 175
 		$client = static::createClient(array(), array(
176 176
 			'PHP_AUTH_USER' => 'UTC001',
177 177
 			'PHP_AUTH_PW'   => 'unittest',
178
-		) );
178
+		));
179 179
 
180
-		$crawler = $this->_goToSummary( $client );
180
+		$crawler = $this->_goToSummary($client);
181 181
 
182
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
182
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
183 183
 
184 184
 
185
-		$link = $crawler->filter( '.checkout-standard .common-summary-service .delivery .modify' )->link();
186
-		$crawler = $client->click( $link );
185
+		$link = $crawler->filter('.checkout-standard .common-summary-service .delivery .modify')->link();
186
+		$crawler = $client->click($link);
187 187
 
188
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-delivery' )->count() );
188
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-delivery')->count());
189 189
 	}
190 190
 
191 191
 
@@ -194,17 +194,17 @@  discard block
 block discarded – undo
194 194
 		$client = static::createClient(array(), array(
195 195
 			'PHP_AUTH_USER' => 'UTC001',
196 196
 			'PHP_AUTH_PW'   => 'unittest',
197
-		) );
197
+		));
198 198
 
199
-		$crawler = $this->_goToSummary( $client );
199
+		$crawler = $this->_goToSummary($client);
200 200
 
201
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
201
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
202 202
 
203 203
 
204
-		$link = $crawler->filter( '.checkout-standard .common-summary-service .payment .modify' )->link();
205
-		$crawler = $client->click( $link );
204
+		$link = $crawler->filter('.checkout-standard .common-summary-service .payment .modify')->link();
205
+		$crawler = $client->click($link);
206 206
 
207
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-payment' )->count() );
207
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-payment')->count());
208 208
 	}
209 209
 
210 210
 
@@ -213,17 +213,17 @@  discard block
 block discarded – undo
213 213
 		$client = static::createClient(array(), array(
214 214
 			'PHP_AUTH_USER' => 'UTC001',
215 215
 			'PHP_AUTH_PW'   => 'unittest',
216
-		) );
216
+		));
217 217
 
218
-		$crawler = $this->_goToSummary( $client );
218
+		$crawler = $this->_goToSummary($client);
219 219
 
220
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
220
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
221 221
 
222 222
 
223
-		$link = $crawler->filter( '.checkout-standard .common-summary-detail .modify' )->link();
224
-		$crawler = $client->click( $link );
223
+		$link = $crawler->filter('.checkout-standard .common-summary-detail .modify')->link();
224
+		$crawler = $client->click($link);
225 225
 
226
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() );
226
+		$this->assertEquals(1, $crawler->filter('.basket-standard')->count());
227 227
 	}
228 228
 
229 229
 
@@ -232,51 +232,51 @@  discard block
 block discarded – undo
232 232
 		$client = static::createClient(array(), array(
233 233
 			'PHP_AUTH_USER' => 'UTC001',
234 234
 			'PHP_AUTH_PW'   => 'unittest',
235
-		) );
235
+		));
236 236
 
237
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
237
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
238 238
 
239
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
240
-		$crawler = $client->click( $link );
239
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
240
+		$crawler = $client->click($link);
241 241
 
242
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
243
-		$crawler = $client->submit( $form );
242
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
243
+		$crawler = $client->submit($form);
244 244
 
245
-		$link = $crawler->filter( '.basket-standard .btn-action' )->link();
246
-		$crawler = $client->click( $link );
245
+		$link = $crawler->filter('.basket-standard .btn-action')->link();
246
+		$crawler = $client->click($link);
247 247
 
248
-		$form = $crawler->filter( '.checkout-standard form' )->form();
249
-		$form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) );
250
-		$crawler = $client->submit( $form );
248
+		$form = $crawler->filter('.checkout-standard form')->form();
249
+		$form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value'));
250
+		$crawler = $client->submit($form);
251 251
 
252
-		$form = $crawler->filter( '.checkout-standard form' )->form();
253
-		$form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) );
254
-		$crawler = $client->submit( $form );
252
+		$form = $crawler->filter('.checkout-standard form')->form();
253
+		$form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value'));
254
+		$crawler = $client->submit($form);
255 255
 
256
-		$form = $crawler->filter( '.checkout-standard form' )->form();
257
-		$payId = $crawler->filter( '.checkout-standard-payment .item-service' )->eq( 1 )->filter( 'input' )->attr( 'value' );
258
-		$form['c_paymentoption']->select( $payId );
259
-		$form['c_payment[' . $payId . '][directdebit.accountowner]'] = 'test user';
260
-		$form['c_payment[' . $payId . '][directdebit.accountno]'] = '12345';
261
-		$form['c_payment[' . $payId . '][directdebit.bankcode]'] = '67890';
262
-		$form['c_payment[' . $payId . '][directdebit.bankname]'] = 'test bank';
263
-		$crawler = $client->submit( $form );
256
+		$form = $crawler->filter('.checkout-standard form')->form();
257
+		$payId = $crawler->filter('.checkout-standard-payment .item-service')->eq(1)->filter('input')->attr('value');
258
+		$form['c_paymentoption']->select($payId);
259
+		$form['c_payment['.$payId.'][directdebit.accountowner]'] = 'test user';
260
+		$form['c_payment['.$payId.'][directdebit.accountno]'] = '12345';
261
+		$form['c_payment['.$payId.'][directdebit.bankcode]'] = '67890';
262
+		$form['c_payment['.$payId.'][directdebit.bankname]'] = 'test bank';
263
+		$crawler = $client->submit($form);
264 264
 
265
-		$this->assertEquals( 1, $crawler->filter( '.checkout-standard-summary' )->count() );
265
+		$this->assertEquals(1, $crawler->filter('.checkout-standard-summary')->count());
266 266
 
267 267
 
268 268
 		// Test if T&C are not accepted
269
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
270
-		$crawler = $client->submit( $form );
269
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
270
+		$crawler = $client->submit($form);
271 271
 
272
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
272
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
273 273
 		$form['cs_option_terms_value']->tick();
274
-		$crawler = $client->submit( $form );
274
+		$crawler = $client->submit($form);
275 275
 
276
-		$form = $crawler->filter( '.checkout-standard .btn-action' )->form();
277
-		$crawler = $client->submit( $form );
276
+		$form = $crawler->filter('.checkout-standard .btn-action')->form();
277
+		$crawler = $client->submit($form);
278 278
 
279
-		$this->assertEquals( 1, $crawler->filter( '.checkout-confirm' )->count() );
279
+		$this->assertEquals(1, $crawler->filter('.checkout-confirm')->count());
280 280
 	}
281 281
 
282 282
 
@@ -284,38 +284,38 @@  discard block
 block discarded – undo
284 284
 	{
285 285
 		$client = static::createClient();
286 286
 
287
-		$client->request( 'GET', '/unittest/de/EUR/update' );
287
+		$client->request('GET', '/unittest/de/EUR/update');
288 288
 
289
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
289
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
290 290
 	}
291 291
 
292 292
 
293 293
 	public function testConfirmComponent()
294 294
 	{
295 295
 		$client = static::createClient();
296
-		$client->request( 'GET', '/unittest/de/EUR/test/checkoutconfirmcomponent' );
296
+		$client->request('GET', '/unittest/de/EUR/test/checkoutconfirmcomponent');
297 297
 
298
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
299
-		$this->assertContains( 'aimeos checkout-confirm', $client->getResponse()->getContent() );
298
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
299
+		$this->assertContains('aimeos checkout-confirm', $client->getResponse()->getContent());
300 300
 	}
301 301
 
302 302
 
303 303
 	public function testStandardComponent()
304 304
 	{
305 305
 		$client = static::createClient();
306
-		$client->request( 'GET', '/unittest/de/EUR/test/checkoutstandardcomponent' );
306
+		$client->request('GET', '/unittest/de/EUR/test/checkoutstandardcomponent');
307 307
 
308
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
309
-		$this->assertContains( 'aimeos checkout-standard', $client->getResponse()->getContent() );
308
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
309
+		$this->assertContains('aimeos checkout-standard', $client->getResponse()->getContent());
310 310
 	}
311 311
 
312 312
 
313 313
 	public function testUpdateComponent()
314 314
 	{
315 315
 		$client = static::createClient();
316
-		$client->request( 'GET', '/unittest/de/EUR/test/checkoutupdatecomponent?code=unitpaymentcode' );
316
+		$client->request('GET', '/unittest/de/EUR/test/checkoutupdatecomponent?code=unitpaymentcode');
317 317
 
318
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
318
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
319 319
 	}
320 320
 
321 321
 
@@ -325,30 +325,30 @@  discard block
 block discarded – undo
325 325
 	 * @param \Symfony\Bundle\FrameworkBundle\Client $client HTTP test client
326 326
 	 * @return \Symfony\Component\DomCrawler\Crawler Crawler HTTP crawler
327 327
 	 */
328
-	protected function _goToSummary( $client )
328
+	protected function _goToSummary($client)
329 329
 	{
330
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
330
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
331 331
 
332
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
333
-		$crawler = $client->click( $link );
332
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
333
+		$crawler = $client->click($link);
334 334
 
335
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
336
-		$crawler = $client->submit( $form );
335
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
336
+		$crawler = $client->submit($form);
337 337
 
338
-		$link = $crawler->filter( '.basket-standard .btn-action' )->link();
339
-		$crawler = $client->click( $link );
338
+		$link = $crawler->filter('.basket-standard .btn-action')->link();
339
+		$crawler = $client->click($link);
340 340
 
341
-		$form = $crawler->filter( '.checkout-standard form' )->form();
342
-		$form['ca_billingoption']->select( $crawler->filter( '.checkout-standard-address .item-address input' )->attr( 'value' ) );
343
-		$crawler = $client->submit( $form );
341
+		$form = $crawler->filter('.checkout-standard form')->form();
342
+		$form['ca_billingoption']->select($crawler->filter('.checkout-standard-address .item-address input')->attr('value'));
343
+		$crawler = $client->submit($form);
344 344
 
345
-		$form = $crawler->filter( '.checkout-standard form' )->form();
346
-		$form['c_deliveryoption']->select( $crawler->filter( '.checkout-standard-delivery .item-service input' )->attr( 'value' ) );
347
-		$crawler = $client->submit( $form );
345
+		$form = $crawler->filter('.checkout-standard form')->form();
346
+		$form['c_deliveryoption']->select($crawler->filter('.checkout-standard-delivery .item-service input')->attr('value'));
347
+		$crawler = $client->submit($form);
348 348
 
349
-		$form = $crawler->filter( '.checkout-standard form' )->form();
350
-		$form['c_paymentoption']->select( $crawler->filter( '.checkout-standard-payment .item-service input' )->attr( 'value' ) );
351
-		$crawler = $client->submit( $form );
349
+		$form = $crawler->filter('.checkout-standard form')->form();
350
+		$form['c_paymentoption']->select($crawler->filter('.checkout-standard-payment .item-service input')->attr('value'));
351
+		$crawler = $client->submit($form);
352 352
 
353 353
 		return $crawler;
354 354
 	}
Please login to merge, or discard this patch.
Tests/Controller/LocaleControllerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
 {
11 11
 	protected function setUp()
12 12
 	{
13
-		\Aimeos\MShop::cache( false );
14
-		\Aimeos\Controller\Frontend::cache( false );
13
+		\Aimeos\MShop::cache(false);
14
+		\Aimeos\Controller\Frontend::cache(false);
15 15
 	}
16 16
 
17 17
 
18 18
 	public function testSelectComponent()
19 19
 	{
20 20
 		$client = static::createClient();
21
-		$client->request( 'GET', '/unittest/de/EUR/test/localeselectcomponent' );
21
+		$client->request('GET', '/unittest/de/EUR/test/localeselectcomponent');
22 22
 
23
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
24
-		$this->assertContains( 'aimeos locale-select', $client->getResponse()->getContent() );
23
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
24
+		$this->assertContains('aimeos locale-select', $client->getResponse()->getContent());
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.
Tests/Controller/AccountControllerTest.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,68 +10,68 @@
 block discarded – undo
10 10
 {
11 11
 	protected function setUp()
12 12
 	{
13
-		\Aimeos\MShop::cache( false );
14
-		\Aimeos\Controller\Frontend::cache( false );
13
+		\Aimeos\MShop::cache(false);
14
+		\Aimeos\Controller\Frontend::cache(false);
15 15
 	}
16 16
 
17 17
 
18 18
 	public function testAccount()
19 19
 	{
20 20
 		$client = static::createClient();
21
-		$client->request( 'GET', '/unittest/de/EUR/myaccount/' );
21
+		$client->request('GET', '/unittest/de/EUR/myaccount/');
22 22
 
23
-		$this->assertContains( 'aimeos account-profile', $client->getResponse()->getContent() );
24
-		$this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() );
25
-		$this->assertContains( 'aimeos account-favorite', $client->getResponse()->getContent() );
26
-		$this->assertContains( 'aimeos account-watch', $client->getResponse()->getContent() );
23
+		$this->assertContains('aimeos account-profile', $client->getResponse()->getContent());
24
+		$this->assertContains('aimeos account-history', $client->getResponse()->getContent());
25
+		$this->assertContains('aimeos account-favorite', $client->getResponse()->getContent());
26
+		$this->assertContains('aimeos account-watch', $client->getResponse()->getContent());
27 27
 	}
28 28
 
29 29
 
30 30
 	public function testDownload()
31 31
 	{
32 32
 		$client = static::createClient();
33
-		$client->request( 'GET', '/unittest/de/EUR/myaccount/download/0' );
33
+		$client->request('GET', '/unittest/de/EUR/myaccount/download/0');
34 34
 
35
-		$this->assertEquals( 401, $client->getResponse()->getStatusCode() );
35
+		$this->assertEquals(401, $client->getResponse()->getStatusCode());
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testFavoriteComponent()
40 40
 	{
41 41
 		$client = static::createClient();
42
-		$client->request( 'GET', '/unittest/de/EUR/test/accountfavoritecomponent' );
42
+		$client->request('GET', '/unittest/de/EUR/test/accountfavoritecomponent');
43 43
 
44
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
45
-		$this->assertContains( 'aimeos account-favorite', $client->getResponse()->getContent() );
44
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
45
+		$this->assertContains('aimeos account-favorite', $client->getResponse()->getContent());
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testHistoryComponent()
50 50
 	{
51 51
 		$client = static::createClient();
52
-		$client->request( 'GET', '/unittest/de/EUR/test/accounthistorycomponent' );
52
+		$client->request('GET', '/unittest/de/EUR/test/accounthistorycomponent');
53 53
 
54
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
55
-		$this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() );
54
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
55
+		$this->assertContains('aimeos account-history', $client->getResponse()->getContent());
56 56
 	}
57 57
 
58 58
 
59 59
 	public function testProfileComponent()
60 60
 	{
61 61
 		$client = static::createClient();
62
-		$client->request( 'GET', '/unittest/de/EUR/test/accountprofilecomponent' );
62
+		$client->request('GET', '/unittest/de/EUR/test/accountprofilecomponent');
63 63
 
64
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
65
-		$this->assertContains( 'aimeos account-profile', $client->getResponse()->getContent() );
64
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
65
+		$this->assertContains('aimeos account-profile', $client->getResponse()->getContent());
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testWatchComponent()
70 70
 	{
71 71
 		$client = static::createClient();
72
-		$client->request( 'GET', '/unittest/de/EUR/test/accountwatchcomponent' );
72
+		$client->request('GET', '/unittest/de/EUR/test/accountwatchcomponent');
73 73
 
74
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
75
-		$this->assertContains( 'aimeos account-watch', $client->getResponse()->getContent() );
74
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
75
+		$this->assertContains('aimeos account-watch', $client->getResponse()->getContent());
76 76
 	}
77 77
 }
Please login to merge, or discard this patch.
Tests/Controller/JsonapiControllerTest.php 1 patch
Spacing   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -9,82 +9,82 @@  discard block
 block discarded – undo
9 9
 {
10 10
 	protected function setUp()
11 11
 	{
12
-		\Aimeos\MShop::cache( false );
13
-		\Aimeos\Controller\Frontend::cache( false );
12
+		\Aimeos\MShop::cache(false);
13
+		\Aimeos\Controller\Frontend::cache(false);
14 14
 	}
15 15
 
16 16
 
17 17
 	public function testOptionsAction()
18 18
 	{
19 19
 		$client = static::createClient();
20
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
20
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
21 21
 		$response = $client->getResponse();
22 22
 
23
-		$json = json_decode( $response->getContent(), true );
23
+		$json = json_decode($response->getContent(), true);
24 24
 
25
-		$this->assertNotNull( $json );
26
-		$this->assertEquals( 200, $response->getStatusCode() );
27
-		$this->assertArrayHasKey( 'resources', $json['meta'] );
28
-		$this->assertGreaterThan( 1, count( $json['meta']['resources'] ) );
25
+		$this->assertNotNull($json);
26
+		$this->assertEquals(200, $response->getStatusCode());
27
+		$this->assertArrayHasKey('resources', $json['meta']);
28
+		$this->assertGreaterThan(1, count($json['meta']['resources']));
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testPutAction()
33 33
 	{
34 34
 		$client = static::createClient();
35
-		$client->request( 'PUT', '/unittest/de/EUR/jsonapi/basket' );
35
+		$client->request('PUT', '/unittest/de/EUR/jsonapi/basket');
36 36
 		$response = $client->getResponse();
37 37
 
38
-		$json = json_decode( $response->getContent(), true );
38
+		$json = json_decode($response->getContent(), true);
39 39
 
40
-		$this->assertNotNull( $json );
41
-		$this->assertEquals( 403, $response->getStatusCode() );
42
-		$this->assertArrayHasKey( 'errors', $json );
40
+		$this->assertNotNull($json);
41
+		$this->assertEquals(403, $response->getStatusCode());
42
+		$this->assertArrayHasKey('errors', $json);
43 43
 	}
44 44
 
45 45
 
46 46
 	public function testGetAttributeAction()
47 47
 	{
48 48
 		$client = static::createClient();
49
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/attribute', [] );
49
+		$client->request('GET', '/unittest/de/EUR/jsonapi/attribute', []);
50 50
 		$response = $client->getResponse();
51 51
 
52
-		$json = json_decode( $response->getContent(), true );
52
+		$json = json_decode($response->getContent(), true);
53 53
 
54
-		$this->assertNotNull( $json );
55
-		$this->assertEquals( 200, $response->getStatusCode() );
56
-		$this->assertEquals( 26, $json['meta']['total'] );
57
-		$this->assertEquals( 25, count( $json['data'] ) );
54
+		$this->assertNotNull($json);
55
+		$this->assertEquals(200, $response->getStatusCode());
56
+		$this->assertEquals(26, $json['meta']['total']);
57
+		$this->assertEquals(25, count($json['data']));
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testGetCatalogAction()
62 62
 	{
63 63
 		$client = static::createClient();
64
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/catalog', [] );
64
+		$client->request('GET', '/unittest/de/EUR/jsonapi/catalog', []);
65 65
 		$response = $client->getResponse();
66 66
 
67
-		$json = json_decode( $response->getContent(), true );
67
+		$json = json_decode($response->getContent(), true);
68 68
 
69
-		$this->assertNotNull( $json );
70
-		$this->assertEquals( 200, $response->getStatusCode() );
71
-		$this->assertEquals( 1, $json['meta']['total'] );
72
-		$this->assertEquals( 4, count( $json['data'] ) );
69
+		$this->assertNotNull($json);
70
+		$this->assertEquals(200, $response->getStatusCode());
71
+		$this->assertEquals(1, $json['meta']['total']);
72
+		$this->assertEquals(4, count($json['data']));
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testGetLocaleAction()
77 77
 	{
78 78
 		$client = static::createClient();
79
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/locale', [] );
79
+		$client->request('GET', '/unittest/de/EUR/jsonapi/locale', []);
80 80
 		$response = $client->getResponse();
81 81
 
82
-		$json = json_decode( $response->getContent(), true );
82
+		$json = json_decode($response->getContent(), true);
83 83
 
84
-		$this->assertNotNull( $json );
85
-		$this->assertEquals( 200, $response->getStatusCode() );
86
-		$this->assertEquals( 1, $json['meta']['total'] );
87
-		$this->assertEquals( 1, count( $json['data'] ) );
84
+		$this->assertNotNull($json);
85
+		$this->assertEquals(200, $response->getStatusCode());
86
+		$this->assertEquals(1, $json['meta']['total']);
87
+		$this->assertEquals(1, count($json['data']));
88 88
 	}
89 89
 
90 90
 
@@ -93,58 +93,58 @@  discard block
 block discarded – undo
93 93
 		$client = static::createClient();
94 94
 
95 95
 		$params = ['filter' => ['f_search' => 'Cafe Noire Cap']];
96
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/product', $params );
96
+		$client->request('GET', '/unittest/de/EUR/jsonapi/product', $params);
97 97
 		$response = $client->getResponse();
98 98
 
99
-		$json = json_decode( $response->getContent(), true );
99
+		$json = json_decode($response->getContent(), true);
100 100
 
101
-		$this->assertNotNull( $json );
102
-		$this->assertEquals( 200, $response->getStatusCode() );
103
-		$this->assertEquals( 2, $json['meta']['total'] );
104
-		$this->assertEquals( 2, count( $json['data'] ) );
105
-		$this->assertArrayHasKey( 'id', $json['data'][0] );
106
-		$this->assertEquals( 'CNC', $json['data'][0]['attributes']['product.code'] );
101
+		$this->assertNotNull($json);
102
+		$this->assertEquals(200, $response->getStatusCode());
103
+		$this->assertEquals(2, $json['meta']['total']);
104
+		$this->assertEquals(2, count($json['data']));
105
+		$this->assertArrayHasKey('id', $json['data'][0]);
106
+		$this->assertEquals('CNC', $json['data'][0]['attributes']['product.code']);
107 107
 
108
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/product?id=' . $json['data'][0]['id'] );
108
+		$client->request('GET', '/unittest/de/EUR/jsonapi/product?id='.$json['data'][0]['id']);
109 109
 		$response = $client->getResponse();
110 110
 
111
-		$json = json_decode( $response->getContent(), true );
111
+		$json = json_decode($response->getContent(), true);
112 112
 
113
-		$this->assertNotNull( $json );
114
-		$this->assertEquals( 200, $response->getStatusCode() );
115
-		$this->assertEquals( 1, $json['meta']['total'] );
116
-		$this->assertArrayHasKey( 'id', $json['data'] );
117
-		$this->assertEquals( 'CNC', $json['data']['attributes']['product.code'] );
113
+		$this->assertNotNull($json);
114
+		$this->assertEquals(200, $response->getStatusCode());
115
+		$this->assertEquals(1, $json['meta']['total']);
116
+		$this->assertArrayHasKey('id', $json['data']);
117
+		$this->assertEquals('CNC', $json['data']['attributes']['product.code']);
118 118
 	}
119 119
 
120 120
 
121 121
 	public function testGetServiceAction()
122 122
 	{
123 123
 		$client = static::createClient();
124
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/service', [] );
124
+		$client->request('GET', '/unittest/de/EUR/jsonapi/service', []);
125 125
 		$response = $client->getResponse();
126 126
 
127
-		$json = json_decode( $response->getContent(), true );
127
+		$json = json_decode($response->getContent(), true);
128 128
 
129
-		$this->assertNotNull( $json );
130
-		$this->assertEquals( 200, $response->getStatusCode() );
131
-		$this->assertEquals( 4, $json['meta']['total'] );
132
-		$this->assertEquals( 4, count( $json['data'] ) );
129
+		$this->assertNotNull($json);
130
+		$this->assertEquals(200, $response->getStatusCode());
131
+		$this->assertEquals(4, $json['meta']['total']);
132
+		$this->assertEquals(4, count($json['data']));
133 133
 	}
134 134
 
135 135
 
136 136
 	public function testGetStockAction()
137 137
 	{
138 138
 		$client = static::createClient();
139
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/stock', ['filter' => ['s_prodcode' => ['CNC', 'CNE']]] );
139
+		$client->request('GET', '/unittest/de/EUR/jsonapi/stock', ['filter' => ['s_prodcode' => ['CNC', 'CNE']]]);
140 140
 		$response = $client->getResponse();
141 141
 
142
-		$json = json_decode( $response->getContent(), true );
142
+		$json = json_decode($response->getContent(), true);
143 143
 
144
-		$this->assertNotNull( $json );
145
-		$this->assertEquals( 200, $response->getStatusCode() );
146
-		$this->assertEquals( 2, $json['meta']['total'] );
147
-		$this->assertEquals( 2, count( $json['data'] ) );
144
+		$this->assertNotNull($json);
145
+		$this->assertEquals(200, $response->getStatusCode());
146
+		$this->assertEquals(2, $json['meta']['total']);
147
+		$this->assertEquals(2, count($json['data']));
148 148
 	}
149 149
 
150 150
 
@@ -152,24 +152,24 @@  discard block
 block discarded – undo
152 152
 	{
153 153
 		$client = static::createClient();
154 154
 
155
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
156
-		$optJson = json_decode( $client->getResponse()->getContent(), true );
157
-		$this->assertGreaterThan( 8, count( $optJson['meta']['resources'] ) );
155
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
156
+		$optJson = json_decode($client->getResponse()->getContent(), true);
157
+		$this->assertGreaterThan(8, count($optJson['meta']['resources']));
158 158
 
159 159
 		// catalog root
160
-		$client->request( 'GET', $optJson['meta']['resources']['catalog'], ['include' => 'catalog'] );
161
-		$json = json_decode( $client->getResponse()->getContent(), true );
162
-		$this->assertEquals( 'categories', $json['included'][0]['attributes']['catalog.code'] );
160
+		$client->request('GET', $optJson['meta']['resources']['catalog'], ['include' => 'catalog']);
161
+		$json = json_decode($client->getResponse()->getContent(), true);
162
+		$this->assertEquals('categories', $json['included'][0]['attributes']['catalog.code']);
163 163
 
164 164
 		// "categories" category
165
-		$client->request( 'GET', $json['included'][0]['links']['self']['href'], ['include' => 'catalog'] );
166
-		$json = json_decode( $client->getResponse()->getContent(), true );
167
-		$this->assertEquals( 'cafe', $json['included'][0]['attributes']['catalog.code'] );
165
+		$client->request('GET', $json['included'][0]['links']['self']['href'], ['include' => 'catalog']);
166
+		$json = json_decode($client->getResponse()->getContent(), true);
167
+		$this->assertEquals('cafe', $json['included'][0]['attributes']['catalog.code']);
168 168
 
169 169
 		// product list for "cafe" category
170
-		$client->request( 'GET', $optJson['meta']['resources']['product'], ['filter' => ['f_catid' => $json['included'][0]['id']]] );
171
-		$json = json_decode( $client->getResponse()->getContent(), true );
172
-		$this->assertEquals( 'CNE', $json['data'][0]['attributes']['product.code'] );
170
+		$client->request('GET', $optJson['meta']['resources']['product'], ['filter' => ['f_catid' => $json['included'][0]['id']]]);
171
+		$json = json_decode($client->getResponse()->getContent(), true);
172
+		$this->assertEquals('CNE', $json['data'][0]['attributes']['product.code']);
173 173
 	}
174 174
 
175 175
 
@@ -177,26 +177,26 @@  discard block
 block discarded – undo
177 177
 	{
178 178
 		$client = static::createClient();
179 179
 
180
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
181
-		$options = json_decode( $client->getResponse()->getContent(), true );
182
-		$this->assertGreaterThan( 8, count( $options['meta']['resources'] ) );
180
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
181
+		$options = json_decode($client->getResponse()->getContent(), true);
182
+		$this->assertGreaterThan(8, count($options['meta']['resources']));
183 183
 
184 184
 		// all available attrbutes
185
-		$client->request( 'GET', $options['meta']['resources']['attribute'] );
186
-		$json = json_decode( $client->getResponse()->getContent(), true );
185
+		$client->request('GET', $options['meta']['resources']['attribute']);
186
+		$json = json_decode($client->getResponse()->getContent(), true);
187 187
 
188
-		foreach( $json['data'] as $entry )
188
+		foreach ($json['data'] as $entry)
189 189
 		{
190
-			if( $entry['attributes']['attribute.code'] === 'xl' )
190
+			if ($entry['attributes']['attribute.code'] === 'xl')
191 191
 			{
192 192
 				// products with attrbute "xl"
193
-				$client->request( 'GET', $options['meta']['resources']['product'], ['filter' => ['f_attrid' => $entry['id']]] );
193
+				$client->request('GET', $options['meta']['resources']['product'], ['filter' => ['f_attrid' => $entry['id']]]);
194 194
 				break;
195 195
 			}
196 196
 		}
197 197
 
198
-		$json = json_decode( $client->getResponse()->getContent(), true );
199
-		$this->assertEquals( 2, $json['meta']['total'] );
198
+		$json = json_decode($client->getResponse()->getContent(), true);
199
+		$this->assertEquals(2, $json['meta']['total']);
200 200
 	}
201 201
 
202 202
 
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
 	{
205 205
 		$client = static::createClient();
206 206
 
207
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
208
-		$json = json_decode( $client->getResponse()->getContent(), true );
209
-		$this->assertGreaterThan( 8, count( $json['meta']['resources'] ) );
207
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
208
+		$json = json_decode($client->getResponse()->getContent(), true);
209
+		$this->assertGreaterThan(8, count($json['meta']['resources']));
210 210
 
211 211
 		// product list for full text search
212
-		$client->request( 'GET', $json['meta']['resources']['product'], ['filter' => ['f_search' => 'cappuccino']] );
213
-		$json = json_decode( $client->getResponse()->getContent(), true );
214
-		$this->assertEquals( 2, count( $json['data'] ) );
212
+		$client->request('GET', $json['meta']['resources']['product'], ['filter' => ['f_search' => 'cappuccino']]);
213
+		$json = json_decode($client->getResponse()->getContent(), true);
214
+		$this->assertEquals(2, count($json['data']));
215 215
 	}
216 216
 
217 217
 
@@ -219,23 +219,23 @@  discard block
 block discarded – undo
219 219
 	{
220 220
 		$client = static::createClient();
221 221
 
222
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
223
-		$json = json_decode( $client->getResponse()->getContent(), true );
224
-		$this->assertGreaterThan( 8, count( $json['meta']['resources'] ) );
222
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
223
+		$json = json_decode($client->getResponse()->getContent(), true);
224
+		$this->assertGreaterThan(8, count($json['meta']['resources']));
225 225
 
226 226
 		// get empty basket
227
-		$client->request( 'GET', $json['meta']['resources']['basket'] );
228
-		$json = json_decode( $client->getResponse()->getContent(), true );
229
-		$this->assertEquals( 'basket', $json['data']['type'] );
227
+		$client->request('GET', $json['meta']['resources']['basket']);
228
+		$json = json_decode($client->getResponse()->getContent(), true);
229
+		$this->assertEquals('basket', $json['data']['type']);
230 230
 
231 231
 		$content = '{"data": {"id": "delivery", "attributes": {"order.base.address.firstname": "test"}}}';
232
-		$client->request( 'POST', $json['links']['basket/address']['href'], [], [], [], $content );
233
-		$json = json_decode( $client->getResponse()->getContent(), true );
234
-		$this->assertEquals( 'basket/address', $json['included'][0]['type'] );
232
+		$client->request('POST', $json['links']['basket/address']['href'], [], [], [], $content);
233
+		$json = json_decode($client->getResponse()->getContent(), true);
234
+		$this->assertEquals('basket/address', $json['included'][0]['type']);
235 235
 
236
-		$client->request( 'DELETE', $json['included'][0]['links']['self']['href'] );
237
-		$json = json_decode( $client->getResponse()->getContent(), true );
238
-		$this->assertEquals( 0, count( $json['included'] ) );
236
+		$client->request('DELETE', $json['included'][0]['links']['self']['href']);
237
+		$json = json_decode($client->getResponse()->getContent(), true);
238
+		$this->assertEquals(0, count($json['included']));
239 239
 	}
240 240
 
241 241
 
@@ -243,31 +243,31 @@  discard block
 block discarded – undo
243 243
 	{
244 244
 		$client = static::createClient();
245 245
 
246
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
247
-		$json = json_decode( $client->getResponse()->getContent(), true );
248
-		$this->assertGreaterThan( 8, count( $json['meta']['resources'] ) );
246
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
247
+		$json = json_decode($client->getResponse()->getContent(), true);
248
+		$this->assertGreaterThan(8, count($json['meta']['resources']));
249 249
 
250 250
 		// product for code "CNC"
251
-		$client->request( 'GET', $json['meta']['resources']['product'], ['filter' => ['==' => ['product.code' => 'CNC']]] );
252
-		$json = json_decode( $client->getResponse()->getContent(), true );
253
-		$this->assertEquals( 1, count( $json['data'] ) );
251
+		$client->request('GET', $json['meta']['resources']['product'], ['filter' => ['==' => ['product.code' => 'CNC']]]);
252
+		$json = json_decode($client->getResponse()->getContent(), true);
253
+		$this->assertEquals(1, count($json['data']));
254 254
 
255 255
 		// add product "CNC" as prerequisite
256
-		$content = '{"data": {"attributes": {"product.id": ' . $json['data'][0]['id'] . '}}}';
257
-		$client->request( 'POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content );
258
-		$json = json_decode( $client->getResponse()->getContent(), true );
259
-		$this->assertEquals( 'basket/product', $json['included'][0]['type'] );
256
+		$content = '{"data": {"attributes": {"product.id": '.$json['data'][0]['id'].'}}}';
257
+		$client->request('POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content);
258
+		$json = json_decode($client->getResponse()->getContent(), true);
259
+		$this->assertEquals('basket/product', $json['included'][0]['type']);
260 260
 
261 261
 		// add coupon "GHIJ"
262 262
 		$content = '{"data": {"id": "GHIJ"}}';
263
-		$client->request( 'POST', $json['links']['basket/coupon']['href'], [], [], [], $content );
264
-		$json = json_decode( $client->getResponse()->getContent(), true );
265
-		$this->assertEquals( 'basket/coupon', $json['included'][2]['type'] );
263
+		$client->request('POST', $json['links']['basket/coupon']['href'], [], [], [], $content);
264
+		$json = json_decode($client->getResponse()->getContent(), true);
265
+		$this->assertEquals('basket/coupon', $json['included'][2]['type']);
266 266
 
267 267
 		// remove coupon "GHIJ" again
268
-		$client->request( 'DELETE', $json['included'][2]['links']['self']['href'] );
269
-		$json = json_decode( $client->getResponse()->getContent(), true );
270
-		$this->assertEquals( 1, count( $json['included'] ) );
268
+		$client->request('DELETE', $json['included'][2]['links']['self']['href']);
269
+		$json = json_decode($client->getResponse()->getContent(), true);
270
+		$this->assertEquals(1, count($json['included']));
271 271
 	}
272 272
 
273 273
 
@@ -275,28 +275,28 @@  discard block
 block discarded – undo
275 275
 	{
276 276
 		$client = static::createClient();
277 277
 
278
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
279
-		$json = json_decode( $client->getResponse()->getContent(), true );
280
-		$this->assertGreaterThan( 8, count( $json['meta']['resources'] ) );
278
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
279
+		$json = json_decode($client->getResponse()->getContent(), true);
280
+		$this->assertGreaterThan(8, count($json['meta']['resources']));
281 281
 
282 282
 		// product for code "CNC"
283
-		$client->request( 'GET', $json['meta']['resources']['product'], ['filter' => ['f_search' => 'ABCD']] );
284
-		$json = json_decode( $client->getResponse()->getContent(), true );
285
-		$this->assertEquals( 1, count( $json['data'] ) );
283
+		$client->request('GET', $json['meta']['resources']['product'], ['filter' => ['f_search' => 'ABCD']]);
284
+		$json = json_decode($client->getResponse()->getContent(), true);
285
+		$this->assertEquals(1, count($json['data']));
286 286
 
287
-		$content = '{"data": {"attributes": {"product.id": ' . $json['data'][0]['id'] . '}}}';
288
-		$client->request( 'POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content );
289
-		$json = json_decode( $client->getResponse()->getContent(), true );
290
-		$this->assertEquals( 'basket/product', $json['included'][0]['type'] );
287
+		$content = '{"data": {"attributes": {"product.id": '.$json['data'][0]['id'].'}}}';
288
+		$client->request('POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content);
289
+		$json = json_decode($client->getResponse()->getContent(), true);
290
+		$this->assertEquals('basket/product', $json['included'][0]['type']);
291 291
 
292 292
 		$content = '{"data": {"attributes": {"quantity": 2}}}';
293
-		$client->request( 'PATCH', $json['included'][0]['links']['self']['href'], [], [], [], $content );
294
-		$json = json_decode( $client->getResponse()->getContent(), true );
295
-		$this->assertEquals( 2, $json['included'][0]['attributes']['order.base.product.quantity'] );
293
+		$client->request('PATCH', $json['included'][0]['links']['self']['href'], [], [], [], $content);
294
+		$json = json_decode($client->getResponse()->getContent(), true);
295
+		$this->assertEquals(2, $json['included'][0]['attributes']['order.base.product.quantity']);
296 296
 
297
-		$client->request( 'DELETE', $json['included'][0]['links']['self']['href'] );
298
-		$json = json_decode( $client->getResponse()->getContent(), true );
299
-		$this->assertEquals( 0, count( $json['included'] ) );
297
+		$client->request('DELETE', $json['included'][0]['links']['self']['href']);
298
+		$json = json_decode($client->getResponse()->getContent(), true);
299
+		$this->assertEquals(0, count($json['included']));
300 300
 	}
301 301
 
302 302
 
@@ -304,14 +304,14 @@  discard block
 block discarded – undo
304 304
 	{
305 305
 		$client = static::createClient();
306 306
 
307
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
308
-		$json = json_decode( $client->getResponse()->getContent(), true );
309
-		$this->assertGreaterThan( 8, count( $json['meta']['resources'] ) );
307
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
308
+		$json = json_decode($client->getResponse()->getContent(), true);
309
+		$this->assertGreaterThan(8, count($json['meta']['resources']));
310 310
 
311 311
 		// payment services
312
-		$client->request( 'GET', $json['meta']['resources']['service'], ['filter' => ['cs_type' => 'payment']] );
313
-		$json = json_decode( $client->getResponse()->getContent(), true );
314
-		$this->assertEquals( 3, count( $json['data'] ) );
312
+		$client->request('GET', $json['meta']['resources']['service'], ['filter' => ['cs_type' => 'payment']]);
313
+		$json = json_decode($client->getResponse()->getContent(), true);
314
+		$this->assertEquals(3, count($json['data']));
315 315
 
316 316
 		$content = ['data' => ['id' => 'payment', 'attributes' => [
317 317
 			'service.id' => $json['data'][1]['id'],
@@ -320,15 +320,15 @@  discard block
 block discarded – undo
320 320
 			'directdebit.bankcode' => 'ABCDEFGH',
321 321
 			'directdebit.bankname' => 'test bank',
322 322
 		]]];
323
-		$client->request( 'POST', $json['data'][1]['links']['basket/service']['href'], [], [], [], json_encode( $content ) );
324
-		$json = json_decode( $client->getResponse()->getContent(), true );
325
-		$this->assertEquals( 'basket/service', $json['included'][0]['type'] );
326
-		$this->assertEquals( 'directdebit-test', $json['included'][0]['attributes']['order.base.service.code'] );
327
-		$this->assertEquals( 5, count( $json['included'][0]['attributes']['attribute'] ) );
328
-
329
-		$client->request( 'DELETE', $json['included'][0]['links']['self']['href'] );
330
-		$json = json_decode( $client->getResponse()->getContent(), true );
331
-		$this->assertEquals( 0, count( $json['included'] ) );
323
+		$client->request('POST', $json['data'][1]['links']['basket/service']['href'], [], [], [], json_encode($content));
324
+		$json = json_decode($client->getResponse()->getContent(), true);
325
+		$this->assertEquals('basket/service', $json['included'][0]['type']);
326
+		$this->assertEquals('directdebit-test', $json['included'][0]['attributes']['order.base.service.code']);
327
+		$this->assertEquals(5, count($json['included'][0]['attributes']['attribute']));
328
+
329
+		$client->request('DELETE', $json['included'][0]['links']['self']['href']);
330
+		$json = json_decode($client->getResponse()->getContent(), true);
331
+		$this->assertEquals(0, count($json['included']));
332 332
 	}
333 333
 
334 334
 
@@ -337,17 +337,17 @@  discard block
 block discarded – undo
337 337
 		$client = static::createClient(array(), array(
338 338
 			'PHP_AUTH_USER' => 'UTC001',
339 339
 			'PHP_AUTH_PW'   => 'unittest',
340
-		) );
340
+		));
341 341
 
342
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/customer', [] );
342
+		$client->request('GET', '/unittest/de/EUR/jsonapi/customer', []);
343 343
 		$response = $client->getResponse();
344 344
 
345
-		$json = json_decode( $response->getContent(), true );
345
+		$json = json_decode($response->getContent(), true);
346 346
 
347
-		$this->assertNotNull( $json );
348
-		$this->assertEquals( 200, $response->getStatusCode() );
349
-		$this->assertEquals( 1, $json['meta']['total'] );
350
-		$this->assertEquals( 4, count( $json['data'] ) );
347
+		$this->assertNotNull($json);
348
+		$this->assertEquals(200, $response->getStatusCode());
349
+		$this->assertEquals(1, $json['meta']['total']);
350
+		$this->assertEquals(4, count($json['data']));
351 351
 	}
352 352
 
353 353
 
@@ -356,22 +356,22 @@  discard block
 block discarded – undo
356 356
 		$client = static::createClient(array(), array(
357 357
 			'PHP_AUTH_USER' => 'UTC001',
358 358
 			'PHP_AUTH_PW'   => 'unittest',
359
-		) );
359
+		));
360 360
 
361
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/customer', [] );
361
+		$client->request('GET', '/unittest/de/EUR/jsonapi/customer', []);
362 362
 		$response = $client->getResponse();
363 363
 
364
-		$json = json_decode( $response->getContent(), true );
364
+		$json = json_decode($response->getContent(), true);
365 365
 
366
-		$client->request( 'GET', $json['links']['customer/address']['href'], [] );
366
+		$client->request('GET', $json['links']['customer/address']['href'], []);
367 367
 		$response = $client->getResponse();
368 368
 
369
-		$json = json_decode( $response->getContent(), true );
369
+		$json = json_decode($response->getContent(), true);
370 370
 
371
-		$this->assertNotNull( $json );
372
-		$this->assertEquals( 200, $response->getStatusCode() );
373
-		$this->assertEquals( 1, $json['meta']['total'] );
374
-		$this->assertEquals( 1, count( $json['data'] ) );
371
+		$this->assertNotNull($json);
372
+		$this->assertEquals(200, $response->getStatusCode());
373
+		$this->assertEquals(1, $json['meta']['total']);
374
+		$this->assertEquals(1, count($json['data']));
375 375
 	}
376 376
 
377 377
 
@@ -380,17 +380,17 @@  discard block
 block discarded – undo
380 380
 		$client = static::createClient(array(), array(
381 381
 			'PHP_AUTH_USER' => 'UTC001',
382 382
 			'PHP_AUTH_PW'   => 'unittest',
383
-		) );
383
+		));
384 384
 
385
-		$client->request( 'GET', '/unittest/de/EUR/jsonapi/order', [] );
385
+		$client->request('GET', '/unittest/de/EUR/jsonapi/order', []);
386 386
 		$response = $client->getResponse();
387 387
 
388
-		$json = json_decode( $response->getContent(), true );
388
+		$json = json_decode($response->getContent(), true);
389 389
 
390
-		$this->assertNotNull( $json );
391
-		$this->assertEquals( 200, $response->getStatusCode() );
392
-		$this->assertEquals( 5, $json['meta']['total'] );
393
-		$this->assertEquals( 5, count( $json['data'] ) );
390
+		$this->assertNotNull($json);
391
+		$this->assertEquals(200, $response->getStatusCode());
392
+		$this->assertEquals(5, $json['meta']['total']);
393
+		$this->assertEquals(5, count($json['data']));
394 394
 	}
395 395
 
396 396
 
@@ -398,63 +398,63 @@  discard block
 block discarded – undo
398 398
 	{
399 399
 		$client = static::createClient();
400 400
 
401
-		$client->request( 'OPTIONS', '/unittest/de/EUR/jsonapi' );
402
-		$optJson = json_decode( $client->getResponse()->getContent(), true );
403
-		$this->assertGreaterThan( 8, count( $optJson['meta']['resources'] ) );
401
+		$client->request('OPTIONS', '/unittest/de/EUR/jsonapi');
402
+		$optJson = json_decode($client->getResponse()->getContent(), true);
403
+		$this->assertGreaterThan(8, count($optJson['meta']['resources']));
404 404
 
405 405
 		// product for code "CNC"
406
-		$client->request( 'GET', $optJson['meta']['resources']['product'], ['filter' => ['==' => ['product.code' => 'CNC']]] );
407
-		$json = json_decode( $client->getResponse()->getContent(), true );
408
-		$this->assertEquals( 1, count( $json['data'] ) );
406
+		$client->request('GET', $optJson['meta']['resources']['product'], ['filter' => ['==' => ['product.code' => 'CNC']]]);
407
+		$json = json_decode($client->getResponse()->getContent(), true);
408
+		$this->assertEquals(1, count($json['data']));
409 409
 
410 410
 		// add product "CNC"
411
-		$content = '{"data": {"attributes": {"product.id": ' . $json['data'][0]['id'] . '}}}';
412
-		$client->request( 'POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content );
413
-		$json = json_decode( $client->getResponse()->getContent(), true );
414
-		$this->assertEquals( 'basket/product', $json['included'][0]['type'] );
411
+		$content = '{"data": {"attributes": {"product.id": '.$json['data'][0]['id'].'}}}';
412
+		$client->request('POST', $json['data'][0]['links']['basket/product']['href'], [], [], [], $content);
413
+		$json = json_decode($client->getResponse()->getContent(), true);
414
+		$this->assertEquals('basket/product', $json['included'][0]['type']);
415 415
 
416 416
 		// delivery services
417
-		$client->request( 'GET', $optJson['meta']['resources']['service'], ['filter' => ['cs_type' => 'delivery']] );
418
-		$json = json_decode( $client->getResponse()->getContent(), true );
419
-		$this->assertEquals( 1, count( $json['data'] ) );
417
+		$client->request('GET', $optJson['meta']['resources']['service'], ['filter' => ['cs_type' => 'delivery']]);
418
+		$json = json_decode($client->getResponse()->getContent(), true);
419
+		$this->assertEquals(1, count($json['data']));
420 420
 
421 421
 		// add delivery service
422
-		$content = '{"data": {"id": "delivery", "attributes": {"service.id": ' . $json['data'][0]['id'] . '}}}';
423
-		$client->request( 'POST', $json['data'][0]['links']['basket/service']['href'], [], [], [], $content );
424
-		$json = json_decode( $client->getResponse()->getContent(), true );
425
-		$this->assertEquals( 'basket/service', $json['included'][1]['type'] );
422
+		$content = '{"data": {"id": "delivery", "attributes": {"service.id": '.$json['data'][0]['id'].'}}}';
423
+		$client->request('POST', $json['data'][0]['links']['basket/service']['href'], [], [], [], $content);
424
+		$json = json_decode($client->getResponse()->getContent(), true);
425
+		$this->assertEquals('basket/service', $json['included'][1]['type']);
426 426
 
427 427
 		// payment services
428
-		$client->request( 'GET', $optJson['meta']['resources']['service'], ['filter' => ['cs_type' => 'payment']] );
429
-		$json = json_decode( $client->getResponse()->getContent(), true );
430
-		$this->assertEquals( 3, count( $json['data'] ) );
428
+		$client->request('GET', $optJson['meta']['resources']['service'], ['filter' => ['cs_type' => 'payment']]);
429
+		$json = json_decode($client->getResponse()->getContent(), true);
430
+		$this->assertEquals(3, count($json['data']));
431 431
 
432 432
 		// add payment service
433
-		$content = '{"data": {"id": "payment", "attributes": {"service.id": ' . $json['data'][0]['id'] . '}}}';
434
-		$client->request( 'POST', $json['data'][0]['links']['basket/service']['href'], [], [], [], $content );
435
-		$json = json_decode( $client->getResponse()->getContent(), true );
436
-		$this->assertEquals( 'basket/service', $json['included'][2]['type'] );
433
+		$content = '{"data": {"id": "payment", "attributes": {"service.id": '.$json['data'][0]['id'].'}}}';
434
+		$client->request('POST', $json['data'][0]['links']['basket/service']['href'], [], [], [], $content);
435
+		$json = json_decode($client->getResponse()->getContent(), true);
436
+		$this->assertEquals('basket/service', $json['included'][2]['type']);
437 437
 
438 438
 		// add address
439 439
 		$content = '{"data": {"id": "payment", "attributes": {"order.base.address.firstname": "test"}}}';
440
-		$client->request( 'POST', $json['links']['basket/address']['href'], [], [], [], $content );
441
-		$json = json_decode( $client->getResponse()->getContent(), true );
442
-		$this->assertEquals( 'basket/address', $json['included'][3]['type'] );
440
+		$client->request('POST', $json['links']['basket/address']['href'], [], [], [], $content);
441
+		$json = json_decode($client->getResponse()->getContent(), true);
442
+		$this->assertEquals('basket/address', $json['included'][3]['type']);
443 443
 
444 444
 		// store basket
445
-		$client->request( 'POST', $json['data']['links']['self']['href'] );
446
-		$basketJson = json_decode( $client->getResponse()->getContent(), true );
447
-		$this->assertEquals( true, ctype_digit( $basketJson['data']['id'] ) );
445
+		$client->request('POST', $json['data']['links']['self']['href']);
446
+		$basketJson = json_decode($client->getResponse()->getContent(), true);
447
+		$this->assertEquals(true, ctype_digit($basketJson['data']['id']));
448 448
 
449 449
 		// add order
450
-		$content = '{"data": {"attributes": {"order.baseid": ' . $basketJson['data']['id'] . '}}}';
451
-		$client->request( 'POST', $basketJson['links']['order']['href'], [], [], [], $content );
452
-		$json = json_decode( $client->getResponse()->getContent(), true );
453
-		$this->assertEquals( true, ctype_digit( $json['data']['id'] ) );
450
+		$content = '{"data": {"attributes": {"order.baseid": '.$basketJson['data']['id'].'}}}';
451
+		$client->request('POST', $basketJson['links']['order']['href'], [], [], [], $content);
452
+		$json = json_decode($client->getResponse()->getContent(), true);
453
+		$this->assertEquals(true, ctype_digit($json['data']['id']));
454 454
 
455 455
 
456 456
 		// delete created order
457
-		$context = static::$kernel->getContainer()->get( 'aimeos.context' )->get();
458
-		\Aimeos\MShop::create( $context, 'order/base' )->deleteItem( $basketJson['data']['id'] );
457
+		$context = static::$kernel->getContainer()->get('aimeos.context')->get();
458
+		\Aimeos\MShop::create($context, 'order/base')->deleteItem($basketJson['data']['id']);
459 459
 	}
460 460
 }
Please login to merge, or discard this patch.
Tests/Controller/BasketControllerTest.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 {
11 11
 	protected function setUp()
12 12
 	{
13
-		\Aimeos\MShop::cache( false );
14
-		\Aimeos\Controller\Frontend::cache( false );
13
+		\Aimeos\MShop::cache(false);
14
+		\Aimeos\Controller\Frontend::cache(false);
15 15
 	}
16 16
 
17 17
 
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$client = static::createClient();
21 21
 
22
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
22
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
23 23
 
24
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
25
-		$crawler = $client->click( $link );
24
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
25
+		$crawler = $client->click($link);
26 26
 
27
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
28
-		$crawler = $client->submit( $form );
27
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
28
+		$crawler = $client->submit($form);
29 29
 
30
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() );
31
-		$this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() );
32
-		$this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') );
30
+		$this->assertEquals(1, $crawler->filter('.basket-standard')->count());
31
+		$this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count());
32
+		$this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value'));
33 33
 	}
34 34
 
35 35
 
@@ -37,18 +37,18 @@  discard block
 block discarded – undo
37 37
 	{
38 38
 		$client = static::createClient();
39 39
 
40
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
40
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
41 41
 
42
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
43
-		$crawler = $client->click( $link );
42
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
43
+		$crawler = $client->click($link);
44 44
 
45
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
45
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
46 46
 		$form['b_prod[0][quantity]'] = 2;
47
-		$crawler = $client->submit( $form );
47
+		$crawler = $client->submit($form);
48 48
 
49
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() );
50
-		$this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() );
51
-		$this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') );
49
+		$this->assertEquals(1, $crawler->filter('.basket-standard')->count());
50
+		$this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count());
51
+		$this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value'));
52 52
 	}
53 53
 
54 54
 
@@ -56,26 +56,26 @@  discard block
 block discarded – undo
56 56
 	{
57 57
 		$client = static::createClient();
58 58
 
59
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
59
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
60 60
 
61
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
62
-		$crawler = $client->click( $link );
61
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
62
+		$crawler = $client->click($link);
63 63
 
64
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
65
-		$crawler = $client->submit( $form );
64
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
65
+		$crawler = $client->submit($form);
66 66
 
67
-		$this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() );
68
-		$this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') );
67
+		$this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count());
68
+		$this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value'));
69 69
 
70 70
 
71
-		$link = $crawler->filter( '.basket-standard .btn-back' )->link();
72
-		$crawler = $client->click( $link );
71
+		$link = $crawler->filter('.basket-standard .btn-back')->link();
72
+		$crawler = $client->click($link);
73 73
 
74
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
75
-		$crawler = $client->submit( $form );
74
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
75
+		$crawler = $client->submit($form);
76 76
 
77
-		$this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() );
78
-		$this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') );
77
+		$this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count());
78
+		$this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value'));
79 79
 	}
80 80
 
81 81
 
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 	{
84 84
 		$client = static::createClient();
85 85
 
86
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
86
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
87 87
 
88
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
89
-		$crawler = $client->click( $link );
88
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
89
+		$crawler = $client->click($link);
90 90
 
91
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
92
-		$crawler = $client->submit( $form );
91
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
92
+		$crawler = $client->submit($form);
93 93
 
94 94
 
95
-		$link = $crawler->filter( '.basket-standard .product .action .delete' )->link();
96
-		$crawler = $client->click( $link );
95
+		$link = $crawler->filter('.basket-standard .product .action .delete')->link();
96
+		$crawler = $client->click($link);
97 97
 
98
-		$this->assertEquals( 0, $crawler->filter( '.basket-standard .product' )->count() );
98
+		$this->assertEquals(0, $crawler->filter('.basket-standard .product')->count());
99 99
 	}
100 100
 
101 101
 
@@ -103,25 +103,25 @@  discard block
 block discarded – undo
103 103
 	{
104 104
 		$client = static::createClient();
105 105
 
106
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
106
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
107 107
 
108
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
109
-		$crawler = $client->click( $link );
108
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
109
+		$crawler = $client->click($link);
110 110
 
111
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
112
-		$crawler = $client->submit( $form );
111
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
112
+		$crawler = $client->submit($form);
113 113
 
114 114
 
115
-		$link = $crawler->filter( '.basket-standard .product .quantity .change' )->link();
116
-		$crawler = $client->click( $link );
115
+		$link = $crawler->filter('.basket-standard .product .quantity .change')->link();
116
+		$crawler = $client->click($link);
117 117
 
118
-		$this->assertEquals( 2, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) );
118
+		$this->assertEquals(2, $crawler->filter('.basket-standard .product .quantity .value')->attr('value'));
119 119
 
120 120
 
121
-		$link = $crawler->filter( '.basket-standard .product .quantity .change' )->eq( 0 )->link();
122
-		$crawler = $client->click( $link );
121
+		$link = $crawler->filter('.basket-standard .product .quantity .change')->eq(0)->link();
122
+		$crawler = $client->click($link);
123 123
 
124
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) );
124
+		$this->assertEquals(1, $crawler->filter('.basket-standard .product .quantity .value')->attr('value'));
125 125
 	}
126 126
 
127 127
 
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
 	{
130 130
 		$client = static::createClient();
131 131
 
132
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
132
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
133 133
 
134
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
135
-		$crawler = $client->click( $link );
134
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
135
+		$crawler = $client->click($link);
136 136
 
137
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
138
-		$crawler = $client->submit( $form );
137
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
138
+		$crawler = $client->submit($form);
139 139
 
140
-		$form = $crawler->filter( '.basket-standard .btn-update' )->form();
140
+		$form = $crawler->filter('.basket-standard .btn-update')->form();
141 141
 		$form['b_prod[0][quantity]'] = 3;
142
-		$crawler = $client->submit( $form );
142
+		$crawler = $client->submit($form);
143 143
 
144
-		$this->assertEquals( 3, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) );
144
+		$this->assertEquals(3, $crawler->filter('.basket-standard .product .quantity .value')->attr('value'));
145 145
 	}
146 146
 
147 147
 
@@ -149,26 +149,26 @@  discard block
 block discarded – undo
149 149
 	{
150 150
 		$client = static::createClient();
151 151
 
152
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
152
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
153 153
 
154
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
155
-		$crawler = $client->click( $link );
154
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
155
+		$crawler = $client->click($link);
156 156
 
157
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
158
-		$crawler = $client->submit( $form );
157
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
158
+		$crawler = $client->submit($form);
159 159
 
160 160
 
161
-		$form = $crawler->filter( '.basket-standard-coupon .coupon-new button' )->form();
161
+		$form = $crawler->filter('.basket-standard-coupon .coupon-new button')->form();
162 162
 		$form['b_coupon'] = '90AB';
163
-		$crawler = $client->submit( $form );
163
+		$crawler = $client->submit($form);
164 164
 
165
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard .product:contains("Geldwerter Nachlass")' )->count() );
165
+		$this->assertEquals(1, $crawler->filter('.basket-standard .product:contains("Geldwerter Nachlass")')->count());
166 166
 
167 167
 
168
-		$link = $crawler->filter( '.basket-standard-coupon .delete' )->link();
169
-		$crawler = $client->click( $link );
168
+		$link = $crawler->filter('.basket-standard-coupon .delete')->link();
169
+		$crawler = $client->click($link);
170 170
 
171
-		$this->assertEquals( 1, $crawler->filter( '.basket-standard .product' )->count() );
171
+		$this->assertEquals(1, $crawler->filter('.basket-standard .product')->count());
172 172
 	}
173 173
 
174 174
 
@@ -176,15 +176,15 @@  discard block
 block discarded – undo
176 176
 	{
177 177
 		$client = static::createClient();
178 178
 
179
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
179
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
180 180
 
181
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link();
182
-		$crawler = $client->click( $link );
181
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link();
182
+		$crawler = $client->click($link);
183 183
 
184
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
185
-		$crawler = $client->submit( $form );
184
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
185
+		$crawler = $client->submit($form);
186 186
 
187
-		$this->assertEquals( 1, $crawler->filter( '.basket-related-bought .product' )->count() );
187
+		$this->assertEquals(1, $crawler->filter('.basket-related-bought .product')->count());
188 188
 	}
189 189
 
190 190
 
@@ -192,47 +192,47 @@  discard block
 block discarded – undo
192 192
 	{
193 193
 		$client = static::createClient();
194 194
 
195
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/list' );
195
+		$crawler = $client->request('GET', '/unittest/de/EUR/list');
196 196
 
197
-		$link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link();
198
-		$crawler = $client->click( $link );
197
+		$link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link();
198
+		$crawler = $client->click($link);
199 199
 
200
-		$form = $crawler->filter( '.catalog-detail .addbasket .btn-primary' )->form();
201
-		$crawler = $client->submit( $form );
200
+		$form = $crawler->filter('.catalog-detail .addbasket .btn-primary')->form();
201
+		$crawler = $client->submit($form);
202 202
 
203
-		$link = $crawler->filter( '.basket-standard .btn-back' )->link();
204
-		$crawler = $client->click( $link );
203
+		$link = $crawler->filter('.basket-standard .btn-back')->link();
204
+		$crawler = $client->click($link);
205 205
 
206
-		$this->assertEquals( 1, $crawler->filter( '.catalog-detail .product:contains("Unittest: Bundle")' )->count() );
206
+		$this->assertEquals(1, $crawler->filter('.catalog-detail .product:contains("Unittest: Bundle")')->count());
207 207
 	}
208 208
 
209 209
 
210 210
 	public function testMiniComponent()
211 211
 	{
212 212
 		$client = static::createClient();
213
-		$client->request( 'GET', '/unittest/de/EUR/test/basketminicomponent' );
213
+		$client->request('GET', '/unittest/de/EUR/test/basketminicomponent');
214 214
 
215
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
216
-		$this->assertContains( 'aimeos basket-mini', $client->getResponse()->getContent() );
215
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
216
+		$this->assertContains('aimeos basket-mini', $client->getResponse()->getContent());
217 217
 	}
218 218
 
219 219
 
220 220
 	public function testRelatedComponent()
221 221
 	{
222 222
 		$client = static::createClient();
223
-		$client->request( 'GET', '/unittest/de/EUR/test/basketrelatedcomponent' );
223
+		$client->request('GET', '/unittest/de/EUR/test/basketrelatedcomponent');
224 224
 
225
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
226
-		$this->assertContains( 'aimeos basket-related', $client->getResponse()->getContent() );
225
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
226
+		$this->assertContains('aimeos basket-related', $client->getResponse()->getContent());
227 227
 	}
228 228
 
229 229
 
230 230
 	public function testStandardComponent()
231 231
 	{
232 232
 		$client = static::createClient();
233
-		$client->request( 'GET', '/unittest/de/EUR/test/basketstandardcomponent' );
233
+		$client->request('GET', '/unittest/de/EUR/test/basketstandardcomponent');
234 234
 
235
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
236
-		$this->assertContains( 'aimeos basket-standard', $client->getResponse()->getContent() );
235
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
236
+		$this->assertContains('aimeos basket-standard', $client->getResponse()->getContent());
237 237
 	}
238 238
 }
Please login to merge, or discard this patch.