Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Behat] Add state transitions to creating orders programmatically #5440

Merged
merged 3 commits into from
Jul 7, 2016

Conversation

GSadee
Copy link
Member

@GSadee GSadee commented Jul 6, 2016

Q A
Bug fix? no
New feature? no
BC breaks? no
Related tickets
License MIT

@@ -239,14 +245,15 @@ public function theCustomerChoseShippingWithPayment(

$this->orderShipmentFactory->processOrderShipment($order);
$order->getShipments()->first()->setMethod($shippingMethod);

$this->orderRecalculator->recalculate($order);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant

@pjedrzejewski pjedrzejewski added the Behat Issues and PRs aimed at improving Behat usage. label Jul 6, 2016
$order->addPayment($payment);

$this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH)->apply(OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT);
$this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH)->apply(OrderCheckoutTransitions::TRANSITION_COMPLETE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could extract this all transitions calls to private method? Would be much cleaner:

private function applyTransition(OrderInterface $order, $transition)
{
    $this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH)->apply($transition);
}

wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad idea :)

@CoderMaggie
Copy link
Member

*[Behat] Add state transitions to creating orders programmatically

@GSadee GSadee changed the title [Behat] Add state transitions to creating programmatically orders [Behat] Add state transitions to creating orders programmatically Jul 7, 2016
@pjedrzejewski pjedrzejewski merged commit 2185759 into Sylius:master Jul 7, 2016
@pjedrzejewski
Copy link
Member

Thanks Grzesiu!

@GSadee GSadee deleted the behat-order-transitions branch September 22, 2017 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Behat Issues and PRs aimed at improving Behat usage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants