assign() public method

public assign ( Sylius\Component\Core\Model\OrderInterface $order, Request $request )
$order Sylius\Component\Core\Model\OrderInterface
$request Symfony\Component\HttpFoundation\Request
 function it_uses_assigner_to_assign_customer_ip_to_order(GenericEvent $event, IpAssignerInterface $ipAssigner, OrderInterface $order, Request $request, RequestStack $requestStack)
 {
     $event->getSubject()->willReturn($order);
     $requestStack->getMasterRequest()->willReturn($request);
     $ipAssigner->assign($order, $request)->shouldBeCalled();
     $this->assignCustomerIpToOrder($event);
 }
Esempio n. 2
0
 /**
  * @param GenericEvent $event
  */
 public function assignCustomerIpToOrder(GenericEvent $event)
 {
     $subject = $event->getSubject();
     Assert::isInstanceOf($subject, OrderInterface::class);
     $this->ipAssigner->assign($subject, $this->requestStack->getMasterRequest());
 }