32 $this->userContext = $this->getMockBuilder(\
Magento\Authorization\Model\UserContextInterface::class)
33 ->getMockForAbstractClass();
34 $this->cartManagement = $this->getMockBuilder(\
Magento\
Quote\Api\CartManagementInterface::class)
35 ->getMockForAbstractClass();
39 'userContext' => $this->userContext,
40 'cartManagement' => $this->cartManagement,
47 $retValue =
'retValue';
50 $this->userContext->expects($this->once())
51 ->method(
'getUserType')
53 $this->userContext->expects($this->once())
58 ->getMockForAbstractClass();
59 $this->cartManagement->expects($this->once())
60 ->method(
'getCartForCustomer')
62 ->will($this->returnValue(
$cart));
63 $cart->expects($this->once())
65 ->will($this->returnValue($retValue));
67 $this->assertSame($retValue, $this->model->getOverriddenValue());
77 $this->userContext->expects($this->once())
78 ->method(
'getUserType')
80 $this->userContext->expects($this->once())
84 $this->cartManagement->expects($this->once())
85 ->method(
'getCartForCustomer')
89 $this->model->getOverriddenValue();
96 $this->userContext->expects($this->once())
97 ->method(
'getUserType')
99 $this->userContext->expects($this->once())
100 ->method(
'getUserId')
103 $this->cartManagement->expects($this->once())
104 ->method(
'getCartForCustomer')
106 ->will($this->returnValue(
null));
108 $this->assertNull($this->model->getOverriddenValue());
113 $this->userContext->expects($this->once())
114 ->method(
'getUserType')
117 $this->assertNull($this->model->getOverriddenValue());
testGetOverriddenValueIsCustomerAndCartDoesNotExist()
testGetOverriddenValueIsNotCustomer()
testGetOverriddenValueIsCustomerAndCartExists()
testGetOverriddenValueIsCustomerAndCartIsNull()