@@ -14,31 +14,30 @@ |
||
| 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; |
| 19 | +use Sylius\Component\Core\Model\AddressInterface; |
|
| 18 | 20 | use Sylius\Component\Core\Model\ChannelInterface; |
| 19 | 21 | use Sylius\Component\Core\Model\ChannelPricingInterface; |
| 20 | -use Sylius\Component\Core\Model\PromotionCouponInterface; |
|
| 21 | -use Sylius\Component\Core\OrderCheckoutTransitions; |
|
| 22 | -use Sylius\Component\Order\Processor\OrderProcessorInterface; |
|
| 23 | -use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface; |
|
| 24 | -use Sylius\Component\Core\Model\AddressInterface; |
|
| 25 | 22 | use Sylius\Component\Core\Model\OrderInterface; |
| 26 | 23 | use Sylius\Component\Core\Model\OrderItemInterface; |
| 27 | 24 | use Sylius\Component\Core\Model\ProductInterface; |
| 28 | 25 | use Sylius\Component\Core\Model\ProductVariantInterface; |
| 26 | +use Sylius\Component\Core\Model\PromotionCouponInterface; |
|
| 29 | 27 | use Sylius\Component\Core\Model\ShippingMethodInterface; |
| 28 | +use Sylius\Component\Core\OrderCheckoutTransitions; |
|
| 30 | 29 | use Sylius\Component\Core\Repository\OrderRepositoryInterface; |
| 31 | -use Sylius\Behat\Service\SharedStorageInterface; |
|
| 30 | +use Sylius\Component\Customer\Model\CustomerInterface; |
|
| 31 | +use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface; |
|
| 32 | 32 | use Sylius\Component\Order\OrderTransitions; |
| 33 | -use Sylius\Component\Payment\Model\PaymentInterface; |
|
| 33 | +use Sylius\Component\Order\Processor\OrderProcessorInterface; |
|
| 34 | 34 | use Sylius\Component\Payment\Model\PaymentMethodInterface; |
| 35 | 35 | use Sylius\Component\Payment\PaymentTransitions; |
| 36 | +use Sylius\Component\Product\Resolver\ProductVariantResolverInterface; |
|
| 36 | 37 | use Sylius\Component\Resource\Factory\FactoryInterface; |
| 37 | 38 | use Sylius\Component\Resource\Repository\RepositoryInterface; |
| 38 | 39 | use Sylius\Component\Shipping\ShipmentTransitions; |
| 39 | -use Sylius\Component\Customer\Model\CustomerInterface; |
|
| 40 | 40 | use Sylius\Component\User\Model\UserInterface; |
| 41 | -use Sylius\Component\Product\Resolver\ProductVariantResolverInterface; |
|
| 42 | 41 | |
| 43 | 42 | /** |
| 44 | 43 | * @author Łukasz Chruściel <[email protected]> |
@@ -13,8 +13,6 @@ |
||
| 13 | 13 | |
| 14 | 14 | use Behat\Mink\Driver\Selenium2Driver; |
| 15 | 15 | use Behat\Mink\Exception\ElementNotFoundException; |
| 16 | -use Sylius\Behat\Behaviour\ChoosesCalculator; |
|
| 17 | -use Sylius\Behat\Behaviour\SpecifiesItsAmount; |
|
| 18 | 16 | use Sylius\Behat\Behaviour\SpecifiesItsCode; |
| 19 | 17 | use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage; |
| 20 | 18 | use Sylius\Component\Core\Formatter\StringInflector; |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 17 | 17 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
| 18 | 18 | use Symfony\Component\DependencyInjection\Parameter; |
| 19 | -use Symfony\Component\DependencyInjection\Reference; |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * @author Paweł Jędrzejewski <[email protected]> |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Sylius\Bundle\PromotionBundle\Form\Type\Action\FixedDiscountConfigurationType; |
| 15 | 15 | use Sylius\Component\Core\Distributor\ProportionalIntegerDistributorInterface; |
| 16 | 16 | use Sylius\Component\Core\Promotion\Applicator\UnitsPromotionAdjustmentsApplicatorInterface; |
| 17 | -use Sylius\Component\Currency\Converter\CurrencyConverterInterface; |
|
| 18 | 17 | use Sylius\Component\Promotion\Model\PromotionInterface; |
| 19 | 18 | use Sylius\Component\Promotion\Model\PromotionSubjectInterface; |
| 20 | 19 | use Webmozart\Assert\Assert; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | use Sylius\Component\Core\Model\ShipmentInterface; |
| 15 | 15 | use Sylius\Component\Shipping\Calculator\CalculatorInterface; |
| 16 | -use Sylius\Component\Shipping\Model\ShipmentInterface as BaseShipmentInterface; |
|
| 16 | +use Sylius\Component\Shipping\Model\ShipmentInterface as BaseShipmentInterface; |
|
| 17 | 17 | use Webmozart\Assert\Assert; |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -57,33 +57,33 @@ |
||
| 57 | 57 | |
| 58 | 58 | $m = 0; |
| 59 | 59 | foreach ($order->getItems() as $item) { |
| 60 | - $details['L_PAYMENTREQUEST_0_NAME'.$m] = $item->getVariant()->getProduct()->getName(); |
|
| 61 | - $details['L_PAYMENTREQUEST_0_AMT'.$m] = $this->formatPrice($item->getDiscountedUnitPrice()); |
|
| 62 | - $details['L_PAYMENTREQUEST_0_QTY'.$m] = $item->getQuantity(); |
|
| 60 | + $details['L_PAYMENTREQUEST_0_NAME' . $m] = $item->getVariant()->getProduct()->getName(); |
|
| 61 | + $details['L_PAYMENTREQUEST_0_AMT' . $m] = $this->formatPrice($item->getDiscountedUnitPrice()); |
|
| 62 | + $details['L_PAYMENTREQUEST_0_QTY' . $m] = $item->getQuantity(); |
|
| 63 | 63 | |
| 64 | 64 | ++$m; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if (0 !== $taxTotal = $order->getAdjustmentsTotalRecursively(AdjustmentInterface::TAX_ADJUSTMENT)) { |
| 68 | - $details['L_PAYMENTREQUEST_0_NAME'.$m] = 'Tax Total'; |
|
| 69 | - $details['L_PAYMENTREQUEST_0_AMT'.$m] = $this->formatPrice($taxTotal); |
|
| 70 | - $details['L_PAYMENTREQUEST_0_QTY'.$m] = 1; |
|
| 68 | + $details['L_PAYMENTREQUEST_0_NAME' . $m] = 'Tax Total'; |
|
| 69 | + $details['L_PAYMENTREQUEST_0_AMT' . $m] = $this->formatPrice($taxTotal); |
|
| 70 | + $details['L_PAYMENTREQUEST_0_QTY' . $m] = 1; |
|
| 71 | 71 | |
| 72 | 72 | ++$m; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if (0 !== $promotionTotal = $order->getOrderPromotionTotal()) { |
| 76 | - $details['L_PAYMENTREQUEST_0_NAME'.$m] = 'Discount'; |
|
| 77 | - $details['L_PAYMENTREQUEST_0_AMT'.$m] = $this->formatPrice($promotionTotal); |
|
| 78 | - $details['L_PAYMENTREQUEST_0_QTY'.$m] = 1; |
|
| 76 | + $details['L_PAYMENTREQUEST_0_NAME' . $m] = 'Discount'; |
|
| 77 | + $details['L_PAYMENTREQUEST_0_AMT' . $m] = $this->formatPrice($promotionTotal); |
|
| 78 | + $details['L_PAYMENTREQUEST_0_QTY' . $m] = 1; |
|
| 79 | 79 | |
| 80 | 80 | ++$m; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if (0 !== $shippingTotal = $order->getShippingTotal()) { |
| 84 | - $details['L_PAYMENTREQUEST_0_NAME'.$m] = 'Shipping Total'; |
|
| 85 | - $details['L_PAYMENTREQUEST_0_AMT'.$m] = $this->formatPrice($shippingTotal); |
|
| 86 | - $details['L_PAYMENTREQUEST_0_QTY'.$m] = 1; |
|
| 84 | + $details['L_PAYMENTREQUEST_0_NAME' . $m] = 'Shipping Total'; |
|
| 85 | + $details['L_PAYMENTREQUEST_0_AMT' . $m] = $this->formatPrice($shippingTotal); |
|
| 86 | + $details['L_PAYMENTREQUEST_0_QTY' . $m] = 1; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $request->setResult($details); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function iSetItsPriceTo($price = null, $channel = null) |
| 168 | 168 | { |
| 169 | - $this->createPage->specifyPrice($price, (null === $channel) ? $this->sharedStorage->get('channel') :$channel); |
|
| 169 | + $this->createPage->specifyPrice($price, (null === $channel) ? $this->sharedStorage->get('channel') : $channel); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | public function iShouldBeNotifiedThatPricesInAllChannelsMustBeDefinedForTheVariant($position) |
| 426 | 426 | { |
| 427 | 427 | Assert::same( |
| 428 | - $this->generatePage->getPricesValidationMessage($position-1), |
|
| 428 | + $this->generatePage->getPricesValidationMessage($position - 1), |
|
| 429 | 429 | 'You must define price for every channel.' |
| 430 | 430 | ); |
| 431 | 431 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | { |
| 474 | 474 | Assert::true( |
| 475 | 475 | $this->indexPage->isSingleResourceWithSpecificElementOnPage(['name' => $productVariantName], sprintf('td > div.ui.label:contains("%s")', $quantity)), |
| 476 | - sprintf('The product variant %s should have %s items on hand, but it does not.',$productVariantName, $quantity) |
|
| 476 | + sprintf('The product variant %s should have %s items on hand, but it does not.', $productVariantName, $quantity) |
|
| 477 | 477 | ); |
| 478 | 478 | } |
| 479 | 479 | |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | |
| 487 | 487 | Assert::true( |
| 488 | 488 | $this->indexPage->isSingleResourceWithSpecificElementOnPage(['name' => $productVariantName], sprintf('td > div.ui.label:contains("%s")', $quantity)), |
| 489 | - sprintf('The product variant %s should have %s items on hand, but it does not.',$productVariantName, $quantity) |
|
| 489 | + sprintf('The product variant %s should have %s items on hand, but it does not.', $productVariantName, $quantity) |
|
| 490 | 490 | ); |
| 491 | 491 | } |
| 492 | 492 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
| 121 | 121 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
| 122 | 122 | |
| 123 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
| 123 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
| 124 | 124 | |
| 125 | 125 | $response = $this->client->getResponse(); |
| 126 | 126 | $this->assertResponse($response, 'currency/show_response', Response::HTTP_OK); |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
| 142 | 142 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
| 143 | 143 | |
| 144 | - $this->client->request('DELETE', '/api/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
| 144 | + $this->client->request('DELETE', '/api/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
| 145 | 145 | |
| 146 | 146 | $response = $this->client->getResponse(); |
| 147 | 147 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
| 148 | 148 | |
| 149 | - $this->client->request('GET', '/api/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
| 149 | + $this->client->request('GET', '/api/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
| 150 | 150 | |
| 151 | 151 | $response = $this->client->getResponse(); |
| 152 | 152 | $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); |