Skip to content
Snippets Groups Projects

OrderRefresh better unlocked order handling via lockBackend service

3 files
+ 19
4
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -7,6 +7,7 @@ use Drupal\commerce_order\Entity\OrderTypeInterface;
use Drupal\commerce_order\OrderRefresh;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Session\AnonymousUserSession;
use Prophecy\Argument;
/**
* Tests the order refresh process.
@@ -96,7 +97,10 @@ class CartOrderRefreshTest extends CartKernelTestBase {
$time = $this->prophesize(TimeInterface::class);
$time->getCurrentTime()->willReturn($current_time);
$time = $time->reveal();
$order_refresh = new OrderRefresh($entity_type_manager, $chain_price_resolver, $user, $time);
$lock_backend = $this->prophesize('Drupal\Core\Lock\LockBackendInterface');
$lock_backend->lockMayBeAvailable(Argument::any())->willReturn(FALSE);
$lock_backend = $lock_backend->reveal();
$order_refresh = new OrderRefresh($entity_type_manager, $chain_price_resolver, $user, $time, $lock_backend);
$order_refresh->addProcessor($this->container->get('commerce_order.availability_order_processor'));
return $order_refresh;
Loading