@@ -49,11 +49,11 @@ protected function setUp(): void
49
49
public function testIsAllowedIfTheQuoteIsBelongedToCustomer ()
50
50
{
51
51
$ quoteCustomerId = 1 ;
52
- $ this ->quoteMock ->expects ( $ this -> any ())-> method ('getCustomerId ' )
52
+ $ this ->quoteMock ->method ('getCustomerId ' )
53
53
->willReturn ($ quoteCustomerId );
54
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
54
+ $ this ->userContextMock ->method ('getUserType ' )
55
55
->willReturn (UserContextInterface::USER_TYPE_CUSTOMER );
56
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserId ' )
56
+ $ this ->userContextMock ->method ('getUserId ' )
57
57
->willReturn ($ quoteCustomerId );
58
58
59
59
$ this ->assertTrue ($ this ->model ->isAllowed ($ this ->quoteMock ));
@@ -64,11 +64,11 @@ public function testIsAllowedIfTheQuoteIsNotBelongedToCustomer()
64
64
$ currentCustomerId = 1 ;
65
65
$ quoteCustomerId = 2 ;
66
66
67
- $ this ->quoteMock ->expects ( $ this -> any ())-> method ('getCustomerId ' )
67
+ $ this ->quoteMock ->method ('getCustomerId ' )
68
68
->willReturn ($ quoteCustomerId );
69
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
69
+ $ this ->userContextMock ->method ('getUserType ' )
70
70
->willReturn (UserContextInterface::USER_TYPE_CUSTOMER );
71
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserId ' )
71
+ $ this ->userContextMock ->method ('getUserId ' )
72
72
->willReturn ($ currentCustomerId );
73
73
74
74
$ this ->assertFalse ($ this ->model ->isAllowed ($ this ->quoteMock ));
@@ -77,33 +77,33 @@ public function testIsAllowedIfTheQuoteIsNotBelongedToCustomer()
77
77
public function testIsAllowedIfQuoteIsBelongedToGuestAndContextIsGuest ()
78
78
{
79
79
$ quoteCustomerId = null ;
80
- $ this ->quoteMock ->expects ( $ this -> any ())-> method ('getCustomerId ' )
80
+ $ this ->quoteMock ->method ('getCustomerId ' )
81
81
->willReturn ($ quoteCustomerId );
82
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
82
+ $ this ->userContextMock ->method ('getUserType ' )
83
83
->willReturn (UserContextInterface::USER_TYPE_GUEST );
84
84
$ this ->assertTrue ($ this ->model ->isAllowed ($ this ->quoteMock ));
85
85
}
86
86
87
87
public function testIsAllowedIfQuoteIsBelongedToCustomerAndContextIsGuest ()
88
88
{
89
89
$ quoteCustomerId = 1 ;
90
- $ this ->quoteMock ->expects ( $ this -> any ())-> method ('getCustomerId ' )
90
+ $ this ->quoteMock ->method ('getCustomerId ' )
91
91
->willReturn ($ quoteCustomerId );
92
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
92
+ $ this ->userContextMock ->method ('getUserType ' )
93
93
->willReturn (UserContextInterface::USER_TYPE_GUEST );
94
94
$ this ->assertFalse ($ this ->model ->isAllowed ($ this ->quoteMock ));
95
95
}
96
96
97
97
public function testIsAllowedIfContextIsAdmin ()
98
98
{
99
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
99
+ $ this ->userContextMock ->method ('getUserType ' )
100
100
->willReturn (UserContextInterface::USER_TYPE_ADMIN );
101
101
$ this ->assertTrue ($ this ->model ->isAllowed ($ this ->quoteMock ));
102
102
}
103
103
104
104
public function testIsAllowedIfContextIsIntegration ()
105
105
{
106
- $ this ->userContextMock ->expects ( $ this -> any ())-> method ('getUserType ' )
106
+ $ this ->userContextMock ->method ('getUserType ' )
107
107
->willReturn (UserContextInterface::USER_TYPE_INTEGRATION );
108
108
$ this ->assertTrue ($ this ->model ->isAllowed ($ this ->quoteMock ));
109
109
}
0 commit comments