@@ -118,8 +118,8 @@ |
||
118 | 118 | private function isAttributeWith($fieldValue, $selector) |
119 | 119 | { |
120 | 120 | $rows = $this->getElement('attributes')->findAll('css', $selector); |
121 | - foreach($rows as $row) { |
|
122 | - if($fieldValue === $row->getText()) { |
|
121 | + foreach ($rows as $row) { |
|
122 | + if ($fieldValue === $row->getText()) { |
|
123 | 123 | return true; |
124 | 124 | } |
125 | 125 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function isEmpty() |
150 | 150 | { |
151 | 151 | $isEmpty = strpos($this->getDocument()->find('css', '.message')->getText(), 'Your cart is empty'); |
152 | - if (false === $isEmpty ) { |
|
152 | + if (false === $isEmpty) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | { |
198 | 198 | $itemsAttributes = $this->getElement('cart items')->findAll('css', $selector); |
199 | 199 | |
200 | - foreach($itemsAttributes as $itemAttribute) { |
|
201 | - if($attributeName === $itemAttribute->getText()) { |
|
200 | + foreach ($itemsAttributes as $itemAttribute) { |
|
201 | + if ($attributeName === $itemAttribute->getText()) { |
|
202 | 202 | return true; |
203 | 203 | } |
204 | 204 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $product->setName($productName); |
164 | 164 | $product->setPrice(0); |
165 | - $product->setDescription('Awesome ' . $productName); |
|
165 | + $product->setDescription('Awesome '.$productName); |
|
166 | 166 | $product->addChannel($channel); |
167 | 167 | |
168 | 168 | $this->productRepository->add($product); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function thisProductHasAttributeWithValue(ProductInterface $product, $productAttributeType, $productAttributeName, $value) |
213 | 213 | { |
214 | - $attribute = $this->createProductAttribute($productAttributeType,$productAttributeName); |
|
214 | + $attribute = $this->createProductAttribute($productAttributeType, $productAttributeName); |
|
215 | 215 | $attributeValue = $this->createProductAttributeValue($value, $attribute); |
216 | 216 | $product->addAttribute($attributeValue); |
217 | 217 | |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function thisProductHasPercentAttributeWithValue(ProductInterface $product, $productAttributeName, $value) |
225 | 225 | { |
226 | - $attribute = $this->createProductAttribute('percent',$productAttributeName); |
|
227 | - $attributeValue = $this->createProductAttributeValue($value/100, $attribute); |
|
226 | + $attribute = $this->createProductAttribute('percent', $productAttributeName); |
|
227 | + $attributeValue = $this->createProductAttributeValue($value / 100, $attribute); |
|
228 | 228 | $product->addAttribute($attributeValue); |
229 | 229 | |
230 | 230 | $this->objectManager->flush(); |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | $product->addOption($option); |
288 | 288 | $product->setVariantSelectionMethod(ProductInterface::VARIANT_SELECTION_MATCH); |
289 | 289 | |
290 | - $this->sharedStorage->set(sprintf('%s_option',$optionName), $option); |
|
291 | - $this->sharedStorage->set(sprintf('%s_option_value',$firstValue), $firstOptionValue); |
|
292 | - $this->sharedStorage->set(sprintf('%s_option_value',$secondValue), $secondOptionValue); |
|
290 | + $this->sharedStorage->set(sprintf('%s_option', $optionName), $option); |
|
291 | + $this->sharedStorage->set(sprintf('%s_option_value', $firstValue), $firstOptionValue); |
|
292 | + $this->sharedStorage->set(sprintf('%s_option_value', $secondValue), $secondOptionValue); |
|
293 | 293 | |
294 | 294 | $this->objectManager->persist($option); |
295 | 295 | $this->objectManager->persist($firstOptionValue); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | /** @var ProductVariantInterface $variant */ |
306 | 306 | $variant = $this->productVariantFactory->createNew(); |
307 | 307 | |
308 | - $optionValue = $this->sharedStorage->get(sprintf('%s_option_value',$optionValueName)); |
|
308 | + $optionValue = $this->sharedStorage->get(sprintf('%s_option_value', $optionValueName)); |
|
309 | 309 | |
310 | 310 | $variant->addOption($optionValue); |
311 | 311 | $variant->setPrice($price); |