Skip to content
Snippets Groups Projects
Commit 21e47f9c authored by Emircan ERKUL's avatar Emircan ERKUL
Browse files

update test case, add comment

parent 4726a80e
No related branches found
No related tags found
1 merge request!203OrderRefresh better unlocked order handling via lockBackend service
......@@ -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;
......
......@@ -77,6 +77,8 @@ class OrderRefresh implements OrderRefreshInterface {
* The current user.
* @param \Drupal\Component\Datetime\TimeInterface $time
* The time.
* @param \Drupal\Core\Lock\LockBackendInterface $lock_backend
* The lock backend.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager, ChainPriceResolverInterface $chain_price_resolver, AccountInterface $current_user, TimeInterface $time, LockBackendInterface $lock_backend) {
$this->orderTypeStorage = $entity_type_manager->getStorage('commerce_order_type');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment