Completed
Push — master ( 95e8d1...b686ff )
by Aimeos
02:04
created
Tests/Controller/BasketControllerTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Aimeos\ShopBundle\Tests\Controller;
4 4
 
5
-use Symfony\Component\HttpFoundation\Response;
6 5
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7 6
 
8 7
 
Please login to merge, or discard this 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.
Tests/Controller/CatalogControllerTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Aimeos\ShopBundle\Tests\Controller;
4 4
 
5
-use Symfony\Component\HttpFoundation\Response;
6 5
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7 6
 
8 7
 
Please login to merge, or discard this 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 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Aimeos\ShopBundle\Tests\Controller;
4 4
 
5
-use Symfony\Component\HttpFoundation\Response;
6 5
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7 6
 
8 7
 
Please login to merge, or discard this 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.
Controller/JsonadmController.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 * @param string $site Unique site code
32 32
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
33 33
 	 */
34
-	public function deleteAction( ServerRequestInterface $request, $resource, $site = 'default' )
34
+	public function deleteAction(ServerRequestInterface $request, $resource, $site = 'default')
35 35
 	{
36
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
37
-		return $client->delete( $request, new Response() );
36
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
37
+		return $client->delete($request, new Response());
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 * @param string $site Unique site code
47 47
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
48 48
 	 */
49
-	public function getAction( ServerRequestInterface $request, $resource, $site = 'default' )
49
+	public function getAction(ServerRequestInterface $request, $resource, $site = 'default')
50 50
 	{
51
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
52
-		return $client->get( $request, new Response() );
51
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
52
+		return $client->get($request, new Response());
53 53
 	}
54 54
 
55 55
 
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 * @param string $site Unique site code
62 62
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
63 63
 	 */
64
-	public function patchAction( ServerRequestInterface $request, $resource, $site = 'default' )
64
+	public function patchAction(ServerRequestInterface $request, $resource, $site = 'default')
65 65
 	{
66
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
67
-		return $client->patch( $request, new Response() );
66
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
67
+		return $client->patch($request, new Response());
68 68
 	}
69 69
 
70 70
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	 * @param string $site Unique site code
77 77
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
78 78
 	 */
79
-	public function postAction( ServerRequestInterface $request, $resource, $site = 'default' )
79
+	public function postAction(ServerRequestInterface $request, $resource, $site = 'default')
80 80
 	{
81
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
82
-		return $client->post( $request, new Response() );
81
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
82
+		return $client->post($request, new Response());
83 83
 	}
84 84
 
85 85
 
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	 * @param string $site Unique site code
92 92
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
93 93
 	 */
94
-	public function putAction( ServerRequestInterface $request, $resource, $site = 'default' )
94
+	public function putAction(ServerRequestInterface $request, $resource, $site = 'default')
95 95
 	{
96
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
97
-		return $client->put( $request, new Response() );
96
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
97
+		return $client->put($request, new Response());
98 98
 	}
99 99
 
100 100
 
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 	 * @param string $site Unique site code
107 107
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
108 108
 	 */
109
-	public function optionsAction( ServerRequestInterface $request, $resource = '', $site = 'default' )
109
+	public function optionsAction(ServerRequestInterface $request, $resource = '', $site = 'default')
110 110
 	{
111
-		$client = $this->createAdmin( $site, $resource, $request->getAttribute( 'lang', 'en' ) );
112
-		return $client->options( $request, new Response() );
111
+		$client = $this->createAdmin($site, $resource, $request->getAttribute('lang', 'en'));
112
+		return $client->options($request, new Response());
113 113
 	}
114 114
 
115 115
 
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
 	 * @param string $lang Language code
122 122
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
123 123
 	 */
124
-	protected function createAdmin( $site, $resource, $lang )
124
+	protected function createAdmin($site, $resource, $lang)
125 125
 	{
126
-		$aimeos = $this->get( 'aimeos' )->get();
127
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' );
126
+		$aimeos = $this->get('aimeos')->get();
127
+		$templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates');
128 128
 
129
-		$context = $this->get( 'aimeos.context' )->get( false, 'backend' );
130
-		$context->setI18n( $this->get('aimeos.i18n')->get( array( $lang, 'en' ) ) );
131
-		$context->setLocale( $this->get('aimeos.locale')->getBackend( $context, $site ) );
129
+		$context = $this->get('aimeos.context')->get(false, 'backend');
130
+		$context->setI18n($this->get('aimeos.i18n')->get(array($lang, 'en')));
131
+		$context->setLocale($this->get('aimeos.locale')->getBackend($context, $site));
132 132
 
133
-		$view = $this->get('aimeos.view')->create( $context, $templatePaths, $lang );
134
-		$context->setView( $view );
133
+		$view = $this->get('aimeos.view')->create($context, $templatePaths, $lang);
134
+		$context->setView($view);
135 135
 
136
-		return \Aimeos\Admin\JsonAdm::create( $context, $aimeos, $resource );
136
+		return \Aimeos\Admin\JsonAdm::create($context, $aimeos, $resource);
137 137
 	}
138 138
 }
Please login to merge, or discard this patch.
Controller/JsonapiController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	 * @param string Resource location, e.g. "customer"
31 31
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
32 32
 	 */
33
-	public function deleteAction( ServerRequestInterface $request, $resource )
33
+	public function deleteAction(ServerRequestInterface $request, $resource)
34 34
 	{
35
-		return $this->createClient( $request, $resource )->delete( $request, new Response() );
35
+		return $this->createClient($request, $resource)->delete($request, new Response());
36 36
 	}
37 37
 
38 38
 
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	 * @param string Resource location, e.g. "customer"
44 44
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
45 45
 	 */
46
-	public function getAction( ServerRequestInterface $request, $resource )
46
+	public function getAction(ServerRequestInterface $request, $resource)
47 47
 	{
48
-		return $this->createClient( $request, $resource )->get( $request, new Response() );
48
+		return $this->createClient($request, $resource)->get($request, new Response());
49 49
 	}
50 50
 
51 51
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 	 * @param string Resource location, e.g. "customer"
57 57
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
58 58
 	 */
59
-	public function patchAction( ServerRequestInterface $request, $resource )
59
+	public function patchAction(ServerRequestInterface $request, $resource)
60 60
 	{
61
-		return $this->createClient( $request, $resource )->patch( $request, new Response() );
61
+		return $this->createClient($request, $resource)->patch($request, new Response());
62 62
 	}
63 63
 
64 64
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @param string Resource location, e.g. "customer"
70 70
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
71 71
 	 */
72
-	public function postAction( ServerRequestInterface $request, $resource )
72
+	public function postAction(ServerRequestInterface $request, $resource)
73 73
 	{
74
-		return $this->createClient( $request, $resource )->post( $request, new Response() );
74
+		return $this->createClient($request, $resource)->post($request, new Response());
75 75
 	}
76 76
 
77 77
 
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 * @param string Resource location, e.g. "customer"
83 83
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
84 84
 	 */
85
-	public function putAction( ServerRequestInterface $request, $resource )
85
+	public function putAction(ServerRequestInterface $request, $resource)
86 86
 	{
87
-		return $this->createClient( $request, $resource )->put( $request, new Response() );
87
+		return $this->createClient($request, $resource)->put($request, new Response());
88 88
 	}
89 89
 
90 90
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	 * @param string Resource location, e.g. "customer"
96 96
 	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
97 97
 	 */
98
-	public function optionsAction( ServerRequestInterface $request, $resource = '' )
98
+	public function optionsAction(ServerRequestInterface $request, $resource = '')
99 99
 	{
100
-		return $this->createClient( $request, $resource )->options( $request, new Response() );
100
+		return $this->createClient($request, $resource)->options($request, new Response());
101 101
 	}
102 102
 
103 103
 
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 	 * @param string Resource location, e.g. "customer"
109 109
 	 * @return \Aimeos\Client\JsonApi\Iface JSON API client
110 110
 	 */
111
-	protected function createClient( ServerRequestInterface $request, $resource )
111
+	protected function createClient(ServerRequestInterface $request, $resource)
112 112
 	{
113 113
 		$args = $request->getAttributes();
114 114
 		$params = $request->getQueryParams();
115
-		$related = ( isset( $args['related'] ) ? $args['related'] : ( isset( $params['related'] ) ? $params['related'] : null ) );
115
+		$related = (isset($args['related']) ? $args['related'] : (isset($params['related']) ? $params['related'] : null));
116 116
 
117
-		$tmplPaths = $this->container->get( 'aimeos' )->get()->getCustomPaths( 'client/jsonapi/templates' );
118
-		$context = $this->container->get( 'aimeos.context' )->get();
117
+		$tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths('client/jsonapi/templates');
118
+		$context = $this->container->get('aimeos.context')->get();
119 119
 		$langid = $context->getLocale()->getLanguageId();
120 120
 
121
-		$view = $this->container->get( 'aimeos.view' )->create( $context, $tmplPaths, $langid );
122
-		$context->setView( $view );
121
+		$view = $this->container->get('aimeos.view')->create($context, $tmplPaths, $langid);
122
+		$context->setView($view);
123 123
 
124
-		return \Aimeos\Client\JsonApi::create( $context, $resource . '/' . $related );
124
+		return \Aimeos\Client\JsonApi::create($context, $resource.'/'.$related);
125 125
 	}
126 126
 }
Please login to merge, or discard this patch.
Controller/AccountController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 	public function indexAction()
31 31
 	{
32 32
 		$params = [];
33
-		$shop = $this->container->get( 'shop' );
33
+		$shop = $this->container->get('shop');
34 34
 
35
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['account-index'] as $name )
35
+		foreach ($this->container->getParameter('aimeos_shop.page')['account-index'] as $name)
36 36
 		{
37
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
38
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
37
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
38
+			$params['aibody'][$name] = $shop->get($name)->getBody();
39 39
 		}
40 40
 
41
-		return $this->render( 'AimeosShopBundle:Account:index.html.twig', $params )->setPrivate()->setMaxAge( 300 );
41
+		return $this->render('AimeosShopBundle:Account:index.html.twig', $params)->setPrivate()->setMaxAge(300);
42 42
 	}
43 43
 
44 44
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function downloadAction()
51 51
 	{
52
-		$response = $this->container->get( 'shop' )->get( 'account/download' )->getView()->response();
53
-		return Response::create( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() );
52
+		$response = $this->container->get('shop')->get('account/download')->getView()->response();
53
+		return Response::create((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders());
54 54
 	}
55 55
 
56 56
 
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function favoriteComponentAction()
63 63
 	{
64
-		$client = $this->container->get( 'shop' )->get( 'account/favorite' );
65
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
64
+		$client = $this->container->get('shop')->get('account/favorite');
65
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
66 66
 
67
-		return new Response( (string) $client->getBody() );
67
+		return new Response((string) $client->getBody());
68 68
 	}
69 69
 
70 70
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function historyComponentAction()
77 77
 	{
78
-		$client = $this->container->get( 'shop' )->get( 'account/history' );
79
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
78
+		$client = $this->container->get('shop')->get('account/history');
79
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
80 80
 
81
-		return new Response( (string) $client->getBody() );
81
+		return new Response((string) $client->getBody());
82 82
 	}
83 83
 
84 84
 
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function profileComponentAction()
91 91
 	{
92
-		$client = $this->container->get( 'shop' )->get( 'account/profile' );
93
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
92
+		$client = $this->container->get('shop')->get('account/profile');
93
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
94 94
 
95
-		return new Response( (string) $client->getBody() );
95
+		return new Response((string) $client->getBody());
96 96
 	}
97 97
 
98 98
 
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function watchComponentAction()
105 105
 	{
106
-		$client = $this->container->get( 'shop' )->get( 'account/watch' );
107
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
106
+		$client = $this->container->get('shop')->get('account/watch');
107
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
108 108
 
109
-		return new Response( (string) $client->getBody() );
109
+		return new Response((string) $client->getBody());
110 110
 	}
111 111
 }
Please login to merge, or discard this patch.
Controller/CheckoutController.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 	public function confirmAction()
31 31
 	{
32 32
 		$params = [];
33
-		$shop = $this->container->get( 'shop' );
33
+		$shop = $this->container->get('shop');
34 34
 
35
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-confirm'] as $name )
35
+		foreach ($this->container->getParameter('aimeos_shop.page')['checkout-confirm'] as $name)
36 36
 		{
37
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
38
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
37
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
38
+			$params['aibody'][$name] = $shop->get($name)->getBody();
39 39
 		}
40 40
 
41
-		$response = $this->render( 'AimeosShopBundle:Checkout:confirm.html.twig', $params );
41
+		$response = $this->render('AimeosShopBundle:Checkout:confirm.html.twig', $params);
42 42
 		$response->headers->set('Cache-Control', 'no-store');
43 43
 		return $response;
44 44
 	}
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 	public function indexAction()
53 53
 	{
54 54
 		$params = [];
55
-		$shop = $this->container->get( 'shop' );
55
+		$shop = $this->container->get('shop');
56 56
 
57
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-index'] as $name )
57
+		foreach ($this->container->getParameter('aimeos_shop.page')['checkout-index'] as $name)
58 58
 		{
59
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
60
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
59
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
60
+			$params['aibody'][$name] = $shop->get($name)->getBody();
61 61
 		}
62 62
 
63
-		$response = $this->render( 'AimeosShopBundle:Checkout:index.html.twig', $params );
63
+		$response = $this->render('AimeosShopBundle:Checkout:index.html.twig', $params);
64 64
 		$response->headers->set('Cache-Control', 'no-store');
65 65
 		return $response;
66 66
 	}
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 	public function updateAction()
75 75
 	{
76 76
 		$params = [];
77
-		$shop = $this->container->get( 'shop' );
77
+		$shop = $this->container->get('shop');
78 78
 
79
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-update'] as $name )
79
+		foreach ($this->container->getParameter('aimeos_shop.page')['checkout-update'] as $name)
80 80
 		{
81
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
82
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
81
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
82
+			$params['aibody'][$name] = $shop->get($name)->getBody();
83 83
 		}
84 84
 
85
-		$response = $this->render( 'AimeosShopBundle:Checkout:update.html.twig', $params );
85
+		$response = $this->render('AimeosShopBundle:Checkout:update.html.twig', $params);
86 86
 		$response->headers->set('Cache-Control', 'no-store');
87 87
 		return $response;
88 88
 	}
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function confirmComponentAction()
97 97
 	{
98
-		$client = $this->container->get( 'shop' )->get( 'checkout/confirm' );
99
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
98
+		$client = $this->container->get('shop')->get('checkout/confirm');
99
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
100 100
 
101
-		$response = new Response( (string) $client->getBody() );
101
+		$response = new Response((string) $client->getBody());
102 102
 		$response->headers->set('Cache-Control', 'no-store');
103 103
 		return $response;
104 104
 	}
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function standardComponentAction()
113 113
 	{
114
-		$client = $this->container->get( 'shop' )->get( 'checkout/standard' );
115
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
114
+		$client = $this->container->get('shop')->get('checkout/standard');
115
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
116 116
 
117
-		$response = new Response( (string) $client->getBody() );
117
+		$response = new Response((string) $client->getBody());
118 118
 		$response->headers->set('Cache-Control', 'no-store');
119 119
 		return $response;
120 120
 	}
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function updateComponentAction()
129 129
 	{
130
-		$client = $this->container->get( 'shop' )->get( 'checkout/update' );
131
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
130
+		$client = $this->container->get('shop')->get('checkout/update');
131
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
132 132
 
133
-		$response = new Response( (string) $client->getBody() );
133
+		$response = new Response((string) $client->getBody());
134 134
 		$response->headers->set('Cache-Control', 'no-store');
135 135
 		return $response;
136 136
 	}
Please login to merge, or discard this patch.
Controller/JqadmController.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@  discard block
 block discarded – undo
29 29
 	 * @param $type File type, i.e. "css" or "js"
30 30
 	 * @return Response Response object
31 31
 	 */
32
-	public function fileAction( $type )
32
+	public function fileAction($type)
33 33
 	{
34 34
 		$contents = '';
35 35
 		$files = array();
36
-		$aimeos = $this->get( 'aimeos' )->get();
36
+		$aimeos = $this->get('aimeos')->get();
37 37
 
38
-		foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths )
38
+		foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths)
39 39
 		{
40
-			foreach( $paths as $path )
40
+			foreach ($paths as $path)
41 41
 			{
42
-				$jsbAbsPath = $base . '/' . $path;
43
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
44
-				$files = array_merge( $files, $jsb2->getFiles( $type ) );
42
+				$jsbAbsPath = $base.'/'.$path;
43
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
44
+				$files = array_merge($files, $jsb2->getFiles($type));
45 45
 			}
46 46
 		}
47 47
 
48
-		foreach( $files as $file )
48
+		foreach ($files as $file)
49 49
 		{
50
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
50
+			if (($content = file_get_contents($file)) !== false) {
51 51
 				$contents .= $content;
52 52
 			}
53 53
 		}
54 54
 
55
-		$response = new Response( $contents );
55
+		$response = new Response($contents);
56 56
 
57
-		if( $type === 'js' ) {
58
-			$response->headers->set( 'Content-Type', 'application/javascript' );
59
-		} elseif( $type === 'css' ) {
60
-			$response->headers->set( 'Content-Type', 'text/css' );
57
+		if ($type === 'js') {
58
+			$response->headers->set('Content-Type', 'application/javascript');
59
+		} elseif ($type === 'css') {
60
+			$response->headers->set('Content-Type', 'text/css');
61 61
 		}
62 62
 
63 63
 		return $response;
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 	 * @param string $site Unique site code
73 73
 	 * @return Response Generated output
74 74
 	 */
75
-	public function copyAction( Request $request, $resource, $site = 'default' )
75
+	public function copyAction(Request $request, $resource, $site = 'default')
76 76
 	{
77
-		$cntl = $this->createAdmin( $request, $site, $resource );
77
+		$cntl = $this->createAdmin($request, $site, $resource);
78 78
 
79
-		if( ( $html = $cntl->copy() ) == '' ) {
79
+		if (($html = $cntl->copy()) == '') {
80 80
 			return $cntl->getView()->response();
81 81
 		}
82 82
 
83
-		return $this->getHtml( $html );
83
+		return $this->getHtml($html);
84 84
 	}
85 85
 
86 86
 
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 	 * @param string $site Unique site code
93 93
 	 * @return Response Generated output
94 94
 	 */
95
-	public function createAction( Request $request, $resource, $site = 'default' )
95
+	public function createAction(Request $request, $resource, $site = 'default')
96 96
 	{
97
-		$cntl = $this->createAdmin( $request, $site, $resource );
97
+		$cntl = $this->createAdmin($request, $site, $resource);
98 98
 
99
-		if( ( $html = $cntl->create() ) == '' ) {
99
+		if (($html = $cntl->create()) == '') {
100 100
 			return $cntl->getView()->response();
101 101
 		}
102 102
 
103
-		return $this->getHtml( $html );
103
+		return $this->getHtml($html);
104 104
 	}
105 105
 
106 106
 
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
 	 * @param string $site Unique site code
113 113
 	 * @return Response Generated output
114 114
 	 */
115
-	public function deleteAction( Request $request, $resource, $site = 'default' )
115
+	public function deleteAction(Request $request, $resource, $site = 'default')
116 116
 	{
117
-		$cntl = $this->createAdmin( $request, $site, $resource );
117
+		$cntl = $this->createAdmin($request, $site, $resource);
118 118
 
119
-		if( ( $html = $cntl->delete() ) == '' ) {
119
+		if (($html = $cntl->delete()) == '') {
120 120
 			return $cntl->getView()->response();
121 121
 		}
122 122
 
123
-		return $this->getHtml( $html );
123
+		return $this->getHtml($html);
124 124
 	}
125 125
 
126 126
 
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 	 * @param string $site Unique site code
133 133
 	 * @return Response Generated output
134 134
 	 */
135
-	public function exportAction( Request $request, $resource, $site = 'default' )
135
+	public function exportAction(Request $request, $resource, $site = 'default')
136 136
 	{
137
-		$cntl = $this->createAdmin( $request, $site, $resource );
137
+		$cntl = $this->createAdmin($request, $site, $resource);
138 138
 
139
-		if( ( $html = $cntl->export() ) == '' ) {
139
+		if (($html = $cntl->export()) == '') {
140 140
 			return $cntl->getView()->response();
141 141
 		}
142 142
 
143
-		return $this->getHtml( $html );
143
+		return $this->getHtml($html);
144 144
 	}
145 145
 
146 146
 
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 	 * @param string $site Unique site code
153 153
 	 * @return Response Generated output
154 154
 	 */
155
-	public function getAction( Request $request, $resource, $site = 'default' )
155
+	public function getAction(Request $request, $resource, $site = 'default')
156 156
 	{
157
-		$cntl = $this->createAdmin( $request, $site, $resource );
157
+		$cntl = $this->createAdmin($request, $site, $resource);
158 158
 
159
-		if( ( $html = $cntl->get() ) == '' ) {
159
+		if (($html = $cntl->get()) == '') {
160 160
 			return $cntl->getView()->response();
161 161
 		}
162 162
 
163
-		return $this->getHtml( $html );
163
+		return $this->getHtml($html);
164 164
 	}
165 165
 
166 166
 
@@ -172,15 +172,15 @@  discard block
 block discarded – undo
172 172
 	 * @param string $site Unique site code
173 173
 	 * @return Response Generated output
174 174
 	 */
175
-	public function saveAction( Request $request, $resource, $site = 'default' )
175
+	public function saveAction(Request $request, $resource, $site = 'default')
176 176
 	{
177
-		$cntl = $this->createAdmin( $request, $site, $resource );
177
+		$cntl = $this->createAdmin($request, $site, $resource);
178 178
 
179
-		if( ( $html = $cntl->save() ) == '' ) {
179
+		if (($html = $cntl->save()) == '') {
180 180
 			return $cntl->getView()->response();
181 181
 		}
182 182
 
183
-		return $this->getHtml( $html );
183
+		return $this->getHtml($html);
184 184
 	}
185 185
 
186 186
 
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
 	 * @param string $site Unique site code
193 193
 	 * @return Response Generated output
194 194
 	 */
195
-	public function searchAction( Request $request, $resource, $site = 'default' )
195
+	public function searchAction(Request $request, $resource, $site = 'default')
196 196
 	{
197
-		$cntl = $this->createAdmin( $request, $site, $resource );
197
+		$cntl = $this->createAdmin($request, $site, $resource);
198 198
 
199
-		if( ( $html = $cntl->search() ) == '' ) {
199
+		if (($html = $cntl->search()) == '') {
200 200
 			return $cntl->getView()->response();
201 201
 		}
202 202
 
203
-		return $this->getHtml( $html );
203
+		return $this->getHtml($html);
204 204
 	}
205 205
 
206 206
 
@@ -212,26 +212,26 @@  discard block
 block discarded – undo
212 212
 	 * @param string $resource Resource location, e.g. "product"
213 213
 	 * @return \Aimeos\Admin\JQAdm\Iface Context item
214 214
 	 */
215
-	protected function createAdmin( Request $request, $site, $resource )
215
+	protected function createAdmin(Request $request, $site, $resource)
216 216
 	{
217
-		$lang = $request->get( 'lang', 'en' );
217
+		$lang = $request->get('lang', 'en');
218 218
 
219
-		$aimeos = $this->get( 'aimeos' )->get();
220
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
219
+		$aimeos = $this->get('aimeos')->get();
220
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
221 221
 
222
-		$context = $this->get( 'aimeos.context' )->get( false, 'backend' );
223
-		$context->setI18n( $this->get( 'aimeos.i18n' )->get( array( $lang, 'en' ) ) );
224
-		$context->setLocale( $this->get( 'aimeos.locale' )->getBackend( $context, $site ) );
222
+		$context = $this->get('aimeos.context')->get(false, 'backend');
223
+		$context->setI18n($this->get('aimeos.i18n')->get(array($lang, 'en')));
224
+		$context->setLocale($this->get('aimeos.locale')->getBackend($context, $site));
225 225
 
226
-		$view = $this->get( 'aimeos.view' )->create( $context, $templatePaths, $lang );
226
+		$view = $this->get('aimeos.view')->create($context, $templatePaths, $lang);
227 227
 
228 228
 		$view->aimeosType = 'Symfony';
229
-		$view->aimeosVersion = $this->get( 'aimeos' )->getVersion();
230
-		$view->aimeosExtensions = implode( ',', $aimeos->getExtensions() );
229
+		$view->aimeosVersion = $this->get('aimeos')->getVersion();
230
+		$view->aimeosExtensions = implode(',', $aimeos->getExtensions());
231 231
 
232
-		$context->setView( $view );
232
+		$context->setView($view);
233 233
 
234
-		return \Aimeos\Admin\JQAdm::create( $context, $aimeos, $resource );
234
+		return \Aimeos\Admin\JQAdm::create($context, $aimeos, $resource);
235 235
 	}
236 236
 
237 237
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 	 * @param string $content Content from admin client
242 242
 	 * @return Response View for rendering the output
243 243
 	 */
244
-	protected function getHtml( $content )
244
+	protected function getHtml($content)
245 245
 	{
246
-		return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) );
246
+		return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content));
247 247
 	}
248 248
 }
Please login to merge, or discard this patch.
Controller/CatalogController.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	public function countAction()
31 31
 	{
32 32
 		$params = [];
33
-		$shop = $this->container->get( 'shop' );
33
+		$shop = $this->container->get('shop');
34 34
 
35
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-count'] as $name )
35
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-count'] as $name)
36 36
 		{
37
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
38
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
37
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
38
+			$params['aibody'][$name] = $shop->get($name)->getBody();
39 39
 		}
40 40
 
41
-		$response = $this->render( 'AimeosShopBundle:Catalog:count.html.twig', $params )->setMaxAge( 300 );
42
-		$response->headers->set( 'Content-Type', 'application/javascript' );
41
+		$response = $this->render('AimeosShopBundle:Catalog:count.html.twig', $params)->setMaxAge(300);
42
+		$response->headers->set('Content-Type', 'application/javascript');
43 43
 		return $response;
44 44
 	}
45 45
 
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 	public function detailAction()
53 53
 	{
54 54
 		$params = [];
55
-		$shop = $this->container->get( 'shop' );
55
+		$shop = $this->container->get('shop');
56 56
 
57
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-detail'] as $name )
57
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-detail'] as $name)
58 58
 		{
59
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
60
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
59
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
60
+			$params['aibody'][$name] = $shop->get($name)->getBody();
61 61
 		}
62 62
 
63
-		return $this->render( 'AimeosShopBundle:Catalog:detail.html.twig', $params );
63
+		return $this->render('AimeosShopBundle:Catalog:detail.html.twig', $params);
64 64
 	}
65 65
 
66 66
 
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 	public function listAction()
73 73
 	{
74 74
 		$params = [];
75
-		$shop = $this->container->get( 'shop' );
75
+		$shop = $this->container->get('shop');
76 76
 
77
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-list'] as $name )
77
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-list'] as $name)
78 78
 		{
79
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
80
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
79
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
80
+			$params['aibody'][$name] = $shop->get($name)->getBody();
81 81
 		}
82 82
 
83
-		return $this->render( 'AimeosShopBundle:Catalog:list.html.twig', $params );
83
+		return $this->render('AimeosShopBundle:Catalog:list.html.twig', $params);
84 84
 	}
85 85
 
86 86
 
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 	public function treeAction()
93 93
 	{
94 94
 		$params = [];
95
-		$shop = $this->container->get( 'shop' );
95
+		$shop = $this->container->get('shop');
96 96
 
97
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-tree'] as $name )
97
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-tree'] as $name)
98 98
 		{
99
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
100
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
99
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
100
+			$params['aibody'][$name] = $shop->get($name)->getBody();
101 101
 		}
102 102
 
103
-		return $this->render( 'AimeosShopBundle:Catalog:tree.html.twig', $params );
103
+		return $this->render('AimeosShopBundle:Catalog:tree.html.twig', $params);
104 104
 	}
105 105
 
106 106
 
@@ -112,16 +112,16 @@  discard block
 block discarded – undo
112 112
 	public function stockAction()
113 113
 	{
114 114
 		$params = [];
115
-		$shop = $this->container->get( 'shop' );
115
+		$shop = $this->container->get('shop');
116 116
 
117
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-stock'] as $name )
117
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-stock'] as $name)
118 118
 		{
119
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
120
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
119
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
120
+			$params['aibody'][$name] = $shop->get($name)->getBody();
121 121
 		}
122 122
 
123
-		$response = $this->render( 'AimeosShopBundle:Catalog:stock.html.twig', $params )->setMaxAge( 30 );
124
-		$response->headers->set( 'Content-Type', 'application/javascript' );
123
+		$response = $this->render('AimeosShopBundle:Catalog:stock.html.twig', $params)->setMaxAge(30);
124
+		$response->headers->set('Content-Type', 'application/javascript');
125 125
 		return $response;
126 126
 	}
127 127
 
@@ -134,16 +134,16 @@  discard block
 block discarded – undo
134 134
 	public function suggestAction()
135 135
 	{
136 136
 		$params = [];
137
-		$shop = $this->container->get( 'shop' );
137
+		$shop = $this->container->get('shop');
138 138
 
139
-		foreach( $this->container->getParameter( 'aimeos_shop.page' )['catalog-suggest'] as $name )
139
+		foreach ($this->container->getParameter('aimeos_shop.page')['catalog-suggest'] as $name)
140 140
 		{
141
-			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
142
-			$params['aibody'][$name] = $shop->get( $name )->getBody();
141
+			$params['aiheader'][$name] = $shop->get($name)->getHeader();
142
+			$params['aibody'][$name] = $shop->get($name)->getBody();
143 143
 		}
144 144
 
145
-		$response = $this->render( 'AimeosShopBundle:Catalog:suggest.html.twig', $params );
146
-		$response->headers->set( 'Content-Type', 'application/json' );
145
+		$response = $this->render('AimeosShopBundle:Catalog:suggest.html.twig', $params);
146
+		$response->headers->set('Content-Type', 'application/json');
147 147
 		return $response;
148 148
 	}
149 149
 
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function countComponentAction()
157 157
 	{
158
-		$client = $this->container->get( 'shop' )->get( 'catalog/count' );
159
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
158
+		$client = $this->container->get('shop')->get('catalog/count');
159
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
160 160
 
161
-		$response = new Response( (string) $client->getBody() );
162
-		$response->headers->set( 'Content-Type', 'application/javascript' );
163
-		return $response->setMaxAge( 300 );
161
+		$response = new Response((string) $client->getBody());
162
+		$response->headers->set('Content-Type', 'application/javascript');
163
+		return $response->setMaxAge(300);
164 164
 	}
165 165
 
166 166
 
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function detailComponentAction()
173 173
 	{
174
-		$client = $this->container->get( 'shop' )->get( 'catalog/detail' );
175
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
174
+		$client = $this->container->get('shop')->get('catalog/detail');
175
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
176 176
 
177
-		return new Response( (string) $client->getBody() );
177
+		return new Response((string) $client->getBody());
178 178
 	}
179 179
 
180 180
 
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	public function filterComponentAction()
187 187
 	{
188
-		$client = $this->container->get( 'shop' )->get( 'catalog/filter' );
189
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
188
+		$client = $this->container->get('shop')->get('catalog/filter');
189
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
190 190
 
191
-		return new Response( (string) $client->getBody() );
191
+		return new Response((string) $client->getBody());
192 192
 	}
193 193
 
194 194
 
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function listComponentAction()
201 201
 	{
202
-		$client = $this->container->get( 'shop' )->get( 'catalog/lists' );
203
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
202
+		$client = $this->container->get('shop')->get('catalog/lists');
203
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
204 204
 
205
-		return new Response( (string) $client->getBody() );
205
+		return new Response((string) $client->getBody());
206 206
 	}
207 207
 
208 208
 
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 	 */
214 214
 	public function sessionComponentAction()
215 215
 	{
216
-		$client = $this->container->get( 'shop' )->get( 'catalog/session' );
217
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
216
+		$client = $this->container->get('shop')->get('catalog/session');
217
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
218 218
 
219
-		return new Response( (string) $client->getBody() );
219
+		return new Response((string) $client->getBody());
220 220
 	}
221 221
 
222 222
 
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	public function stageComponentAction()
229 229
 	{
230
-		$client = $this->container->get( 'shop' )->get( 'catalog/stage' );
231
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
230
+		$client = $this->container->get('shop')->get('catalog/stage');
231
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
232 232
 
233
-		return new Response( (string) $client->getBody() );
233
+		return new Response((string) $client->getBody());
234 234
 	}
235 235
 
236 236
 
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function stockComponentAction()
243 243
 	{
244
-		$client = $this->container->get( 'shop' )->get( 'catalog/stock' );
245
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
244
+		$client = $this->container->get('shop')->get('catalog/stock');
245
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
246 246
 
247
-		$response = new Response( (string) $client->getBody() );
248
-		$response->headers->set( 'Content-Type', 'application/javascript' );
249
-		return $response->setMaxAge( 30 );
247
+		$response = new Response((string) $client->getBody());
248
+		$response->headers->set('Content-Type', 'application/javascript');
249
+		return $response->setMaxAge(30);
250 250
 	}
251 251
 
252 252
 
@@ -257,11 +257,11 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function suggestComponentAction()
259 259
 	{
260
-		$client = $this->container->get( 'shop' )->get( 'catalog/suggest' );
261
-		$this->container->get( 'twig' )->addGlobal( 'aiheader', (string) $client->getHeader() );
260
+		$client = $this->container->get('shop')->get('catalog/suggest');
261
+		$this->container->get('twig')->addGlobal('aiheader', (string) $client->getHeader());
262 262
 
263
-		$response = new Response( (string) $client->getBody() );
264
-		$response->headers->set( 'Content-Type', 'application/json' );
263
+		$response = new Response((string) $client->getBody());
264
+		$response->headers->set('Content-Type', 'application/json');
265 265
 		return $response;
266 266
 	}
267 267
 }
Please login to merge, or discard this patch.