コード例 #1
0
 function it_performs_action_as_given_admin_user_and_logout(SecurityServiceInterface $adminSecurityService, OrderInterface $order, AdminUserInterface $adminUser)
 {
     $adminSecurityService->getCurrentToken()->willThrow(TokenNotFoundException::class);
     $adminSecurityService->logIn($adminUser)->shouldBeCalled();
     $order->completeCheckout()->shouldBeCalled();
     $adminSecurityService->restoreToken(Argument::any())->shouldNotBeCalled();
     $adminSecurityService->logOut()->shouldBeCalled();
     $wrappedOrder = $order->getWrappedObject();
     $this->performActionAsAdminUser($adminUser, function () use($wrappedOrder) {
         $wrappedOrder->completeCheckout();
     });
 }
コード例 #2
0
 /**
  * @param OrderInterface $order
  */
 public function completeCheckout(OrderInterface $order)
 {
     $order->completeCheckout();
 }
コード例 #3
0
 function it_completes_an_order(OrderInterface $order)
 {
     $order->completeCheckout()->shouldBeCalled();
     $this->completeCheckout($order);
 }