30 $this->session = $this->getMockBuilder(Session::class)
31 ->disableOriginalConstructor()
34 $this->checkout =
new Checkout($this->session);
43 $order = $this->getMockBuilder(Order::class)
44 ->disableOriginalConstructor()
47 $this->session->expects(static::once())
48 ->method(
'getLastRealOrder')
50 $order->expects(static::once())
53 $order->expects(static::once())
56 $order->expects(static::once())
57 ->method(
'registerCancellation')
60 $order->expects(static::once())
63 static::assertTrue($this->checkout->cancelCurrentOrder($comment));
72 $order = $this->getMockBuilder(Order::class)
73 ->disableOriginalConstructor()
76 $this->session->expects(static::once())
77 ->method(
'getLastRealOrder')
79 $order->expects(static::once())
82 $order->expects(static::once())
85 $order->expects(static::never())
86 ->method(
'registerCancellation')
89 $order->expects(static::never())
92 static::assertFalse($this->checkout->cancelCurrentOrder($comment));
97 $this->session->expects(static::once())
98 ->method(
'restoreQuote')
101 static::assertTrue($this->checkout->restoreQuote());
testCancelCurrentOrderWhichIsCancelled()
const STATE_PENDING_PAYMENT