@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
123 | 123 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
124 | 124 | |
125 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
125 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
126 | 126 | |
127 | 127 | $response = $this->client->getResponse(); |
128 | 128 | $this->assertResponse($response, 'currency/show_response', Response::HTTP_OK); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
152 | 152 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
153 | 153 | |
154 | - $this->client->request('PUT', '/api/currencies/'.$currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
154 | + $this->client->request('PUT', '/api/currencies/' . $currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
155 | 155 | |
156 | 156 | $response = $this->client->getResponse(); |
157 | 157 | |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | } |
173 | 173 | EOT; |
174 | 174 | |
175 | - $this->client->request('PUT', '/api/currencies/'.$currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
175 | + $this->client->request('PUT', '/api/currencies/' . $currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
176 | 176 | |
177 | 177 | $response = $this->client->getResponse(); |
178 | 178 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
179 | 179 | |
180 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
180 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
181 | 181 | |
182 | 182 | $response = $this->client->getResponse(); |
183 | 183 | $this->assertResponse($response, 'currency/update_response', Response::HTTP_OK); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | } |
207 | 207 | EOT; |
208 | 208 | |
209 | - $this->client->request('PATCH', '/api/currencies/'.$currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
209 | + $this->client->request('PATCH', '/api/currencies/' . $currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
210 | 210 | |
211 | 211 | $response = $this->client->getResponse(); |
212 | 212 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
213 | 213 | |
214 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
214 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_2']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
215 | 215 | |
216 | 216 | $response = $this->client->getResponse(); |
217 | 217 | $this->assertResponse($response, 'currency/update_response', Response::HTTP_OK); |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
233 | 233 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
234 | 234 | |
235 | - $this->client->request('DELETE', '/api/currencies/'.$currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithContentType, []); |
|
235 | + $this->client->request('DELETE', '/api/currencies/' . $currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithContentType, []); |
|
236 | 236 | |
237 | 237 | $response = $this->client->getResponse(); |
238 | 238 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
239 | 239 | |
240 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
240 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_1']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
241 | 241 | |
242 | 242 | $response = $this->client->getResponse(); |
243 | 243 | $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | }, |
35 | 35 | "author": "Christie Golden" |
36 | 36 | } |
37 | -EOT; |
|
37 | +eot; |
|
38 | 38 | |
39 | 39 | $this->client->request('POST', '/books/', [], [], ['CONTENT_TYPE' => 'application/json'], $data); |
40 | 40 | $response = $this->client->getResponse(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | }, |
62 | 62 | "author": "Christie Golden" |
63 | 63 | } |
64 | -EOT; |
|
64 | +eot; |
|
65 | 65 | |
66 | 66 | $this->client->request('PUT', '/books/'. $objects["book1"]->getId(), [], [], ['CONTENT_TYPE' => 'application/json'], $data); |
67 | 67 | $response = $this->client->getResponse(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | "author": "Christie Golden" |
82 | 82 | } |
83 | -EOT; |
|
83 | +eot; |
|
84 | 84 | |
85 | 85 | $this->client->request('PATCH', '/books/'. $objects["book1"]->getId(), [], [], ['CONTENT_TYPE' => 'application/json'], $data); |
86 | 86 | $response = $this->client->getResponse(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
41 | 41 | $countryData = $this->loadFixturesFromFile('resources/countries.yml'); |
42 | 42 | |
43 | - $this->client->request('GET', '/api/countries/'.$countryData['country_BE']->getId().'/provinces/'.$countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
43 | + $this->client->request('GET', '/api/countries/' . $countryData['country_BE']->getId() . '/provinces/' . $countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
44 | 44 | |
45 | 45 | $response = $this->client->getResponse(); |
46 | 46 | $this->assertResponse($response, 'province/show_response', Response::HTTP_OK); |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
52 | 52 | $countryData = $this->loadFixturesFromFile('resources/countries.yml'); |
53 | 53 | |
54 | - $this->client->request('DELETE', '/api/countries/'.$countryData['country_BE']->getId().'/provinces/'.$countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
54 | + $this->client->request('DELETE', '/api/countries/' . $countryData['country_BE']->getId() . '/provinces/' . $countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
55 | 55 | |
56 | 56 | $response = $this->client->getResponse(); |
57 | 57 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
58 | 58 | |
59 | - $this->client->request('GET', '/api/countries/'.$countryData['country_BE']->getId().'/provinces/'.$countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
59 | + $this->client->request('GET', '/api/countries/' . $countryData['country_BE']->getId() . '/provinces/' . $countryData['province_BE_limburg']->getId(), [], [], static::$authorizedHeaderWithContentType); |
|
60 | 60 | |
61 | 61 | $response = $this->client->getResponse(); |
62 | 62 | $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
97 | 97 | $countries = $this->loadFixturesFromFile('resources/countries.yml'); |
98 | 98 | |
99 | - $this->client->request('GET', '/api/countries/'.$countries['country_NL']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
99 | + $this->client->request('GET', '/api/countries/' . $countries['country_NL']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
100 | 100 | |
101 | 101 | $response = $this->client->getResponse(); |
102 | 102 | $this->assertResponse($response, 'country/show_response', Response::HTTP_OK); |
@@ -91,6 +91,6 @@ |
||
91 | 91 | |
92 | 92 | <info>php %command.full_name% web --symlink --relative</info> |
93 | 93 | |
94 | -EOT; |
|
94 | +eot; |
|
95 | 95 | } |
96 | 96 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | { |
311 | 311 | $customer = $user->getCustomer(); |
312 | 312 | for ($i = 0; $i < $numberOfOrders; $i++) { |
313 | - $order = $this->createOrder($customer, '#00000'.$i); |
|
313 | + $order = $this->createOrder($customer, '#00000' . $i); |
|
314 | 314 | $order->setPaymentState(PaymentInterface::STATE_COMPLETED); |
315 | 315 | $order->setCompletedAt(new \DateTime()); |
316 | 316 | |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | $total = $this->getPriceFromString($total); |
359 | 359 | |
360 | 360 | for ($i = 0; $i < $numberOfOrders; $i++) { |
361 | - $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#'.uniqid()); |
|
361 | + $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#' . uniqid()); |
|
362 | 362 | $order->setPaymentState(PaymentInterface::STATE_COMPLETED); |
363 | 363 | $order->setCompletedAt(new \DateTime()); |
364 | 364 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $customer = $this->customerFactory->createNew(); |
503 | 503 | $customer->setEmail(sprintf('john%[email protected]', uniqid())); |
504 | 504 | $customer->setFirstname('John'); |
505 | - $customer->setLastname('Doe'.$i); |
|
505 | + $customer->setLastname('Doe' . $i); |
|
506 | 506 | |
507 | 507 | $customers[] = $customer; |
508 | 508 |
@@ -14,30 +14,29 @@ |
||
14 | 14 | use Behat\Behat\Context\Context; |
15 | 15 | use Doctrine\Common\Persistence\ObjectManager; |
16 | 16 | use SM\Factory\FactoryInterface as StateMachineFactoryInterface; |
17 | +use Sylius\Behat\Service\SharedStorageInterface; |
|
17 | 18 | use Sylius\Component\Core\Currency\CurrencyStorageInterface; |
18 | -use Sylius\Component\Core\Model\ChannelInterface; |
|
19 | -use Sylius\Component\Core\Model\PromotionCouponInterface; |
|
20 | -use Sylius\Component\Core\OrderCheckoutTransitions; |
|
21 | -use Sylius\Component\Order\Processor\OrderProcessorInterface; |
|
22 | -use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface; |
|
23 | 19 | use Sylius\Component\Core\Model\AddressInterface; |
20 | +use Sylius\Component\Core\Model\ChannelInterface; |
|
24 | 21 | use Sylius\Component\Core\Model\OrderInterface; |
25 | 22 | use Sylius\Component\Core\Model\OrderItemInterface; |
26 | 23 | use Sylius\Component\Core\Model\ProductInterface; |
27 | 24 | use Sylius\Component\Core\Model\ProductVariantInterface; |
25 | +use Sylius\Component\Core\Model\PromotionCouponInterface; |
|
28 | 26 | use Sylius\Component\Core\Model\ShippingMethodInterface; |
27 | +use Sylius\Component\Core\OrderCheckoutTransitions; |
|
29 | 28 | use Sylius\Component\Core\Repository\OrderRepositoryInterface; |
30 | -use Sylius\Behat\Service\SharedStorageInterface; |
|
29 | +use Sylius\Component\Customer\Model\CustomerInterface; |
|
30 | +use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface; |
|
31 | 31 | use Sylius\Component\Order\OrderTransitions; |
32 | -use Sylius\Component\Payment\Model\PaymentInterface; |
|
32 | +use Sylius\Component\Order\Processor\OrderProcessorInterface; |
|
33 | 33 | use Sylius\Component\Payment\Model\PaymentMethodInterface; |
34 | 34 | use Sylius\Component\Payment\PaymentTransitions; |
35 | +use Sylius\Component\Product\Resolver\ProductVariantResolverInterface; |
|
35 | 36 | use Sylius\Component\Resource\Factory\FactoryInterface; |
36 | 37 | use Sylius\Component\Resource\Repository\RepositoryInterface; |
37 | 38 | use Sylius\Component\Shipping\ShipmentTransitions; |
38 | -use Sylius\Component\Customer\Model\CustomerInterface; |
|
39 | 39 | use Sylius\Component\User\Model\UserInterface; |
40 | -use Sylius\Component\Product\Resolver\ProductVariantResolverInterface; |
|
41 | 40 | |
42 | 41 | /** |
43 | 42 | * @author Łukasz Chruściel <[email protected]> |
@@ -212,6 +212,6 @@ |
||
212 | 212 | */ |
213 | 213 | private function getCodeFromNameAndZoneCode($taxRateName, $zoneCode) |
214 | 214 | { |
215 | - return $this->getCodeFromName($taxRateName).'_'.strtolower($zoneCode); |
|
215 | + return $this->getCodeFromName($taxRateName) . '_' . strtolower($zoneCode); |
|
216 | 216 | } |
217 | 217 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * |
68 | 68 | * @throws \RuntimeException |
69 | 69 | * |
70 | - * @return string |
|
70 | + * @return integer |
|
71 | 71 | */ |
72 | 72 | private function tryToMapPaymentMethodName($paymentMethodName) |
73 | 73 | { |
@@ -15,9 +15,9 @@ |
||
15 | 15 | use Sylius\Behat\Page\Admin\Channel\IndexPageInterface; |
16 | 16 | use Sylius\Behat\Page\Admin\Channel\UpdatePageInterface; |
17 | 17 | use Sylius\Behat\Page\Shop\HomePageInterface; |
18 | +use Sylius\Behat\Service\SharedStorageInterface; |
|
18 | 19 | use Sylius\Bundle\ThemeBundle\Model\ThemeInterface; |
19 | 20 | use Sylius\Component\Core\Model\ChannelInterface; |
20 | -use Sylius\Behat\Service\SharedStorageInterface; |
|
21 | 21 | use Webmozart\Assert\Assert; |
22 | 22 | |
23 | 23 | /** |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | */ |
531 | 531 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
532 | 532 | { |
533 | - $address = $this->sharedStorage->get('shipping_address_'.StringInflector::nameToLowercaseCode($fullName)); |
|
533 | + $address = $this->sharedStorage->get('shipping_address_' . StringInflector::nameToLowercaseCode($fullName)); |
|
534 | 534 | Assert::true( |
535 | 535 | $this->summaryPage->hasShippingAddress($address), |
536 | 536 | 'Shipping address is improper.' |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
544 | 544 | { |
545 | - $address = $this->sharedStorage->get('billing_address_'.StringInflector::nameToLowercaseCode($fullName)); |
|
545 | + $address = $this->sharedStorage->get('billing_address_' . StringInflector::nameToLowercaseCode($fullName)); |
|
546 | 546 | Assert::true( |
547 | 547 | $this->summaryPage->hasBillingAddress($address), |
548 | 548 | 'Billing address is improper.' |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | { |
623 | 623 | Assert::true( |
624 | 624 | $this->summaryPage->hasShippingTotal($price), |
625 | - sprintf('The shipping total should be %s, but it is not.',$price) |
|
625 | + sprintf('The shipping total should be %s, but it is not.', $price) |
|
626 | 626 | ); |
627 | 627 | } |
628 | 628 |
@@ -1261,7 +1261,7 @@ |
||
1261 | 1261 | { |
1262 | 1262 | Assert::true( |
1263 | 1263 | $this->selectPaymentPage->isNextStepButtonUnavailable(), |
1264 | - 'The "next step" button should be disabled.' |
|
1264 | + 'The "next step" button should be disabled.' |
|
1265 | 1265 | ); |
1266 | 1266 | } |
1267 | 1267 |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | { |
201 | 201 | $this->dialog = $this->command->getHelper('dialog'); |
202 | 202 | $inputString = join(PHP_EOL, $this->inputChoices); |
203 | - $this->dialog->setInputStream($this->getInputStream($inputString.PHP_EOL)); |
|
203 | + $this->dialog->setInputStream($this->getInputStream($inputString . PHP_EOL)); |
|
204 | 204 | |
205 | 205 | $this->tester->execute(['command' => $name]); |
206 | 206 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | private function iExecuteCommandAndConfirm($name) |
212 | 212 | { |
213 | 213 | $this->dialog = $this->command->getHelper('dialog'); |
214 | - $inputString = 'y'.PHP_EOL; |
|
214 | + $inputString = 'y' . PHP_EOL; |
|
215 | 215 | $this->dialog->setInputStream($this->getInputStream($inputString)); |
216 | 216 | |
217 | 217 | $this->tester->execute(['command' => $name]); |
@@ -159,7 +159,7 @@ |
||
159 | 159 | (stripos($elementText, $customerName) !== false) && |
160 | 160 | (stripos($elementText, $street) !== false) && |
161 | 161 | (stripos($elementText, $city) !== false) && |
162 | - (stripos($elementText, $countryName.' '.$postcode) !== false) |
|
162 | + (stripos($elementText, $countryName . ' ' . $postcode) !== false) |
|
163 | 163 | ; |
164 | 164 | } |
165 | 165 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $provinces = $this->getElement('provinces'); |
42 | 42 | |
43 | - return $provinces->has('css', '[value = "'.$provinceName.'"]'); |
|
43 | + return $provinces->has('css', '[value = "' . $provinceName . '"]'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $provinces = $this->getElement('provinces'); |
52 | 52 | |
53 | - return $provinces->has('css', '[value = "'.$provinceCode.'"]'); |
|
53 | + return $provinces->has('css', '[value = "' . $provinceCode . '"]'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if ($this->isThereProvince($provinceName)) { |
138 | 138 | $provinces = $this->getElement('provinces'); |
139 | 139 | |
140 | - $item = $provinces->find('css', 'div[data-form-collection="item"] input[value="'.$provinceName.'"]')->getParent(); |
|
140 | + $item = $provinces->find('css', 'div[data-form-collection="item"] input[value="' . $provinceName . '"]')->getParent(); |
|
141 | 141 | $item->fillField('Name', ''); |
142 | 142 | } |
143 | 143 | } |