@@ -129,16 +129,36 @@ public function testCollect()
129
129
$ regionId = 'CA ' ;
130
130
$ regionMock = $ this ->createMock (RegionInterface::class);
131
131
132
- $ this ->customerSessionMock ->expects (self ::once ())->method ('isLoggedIn ' )->willReturn (true );
133
- $ this ->customerSessionMock ->expects (self ::once ())->method ('getCustomerId ' )->willReturn ($ customerId );
134
- $ this ->customerRepositoryMock ->expects (self ::once ())->method ('getById ' )->willReturn ($ this ->customerMock );
135
- $ this ->customerMock ->expects (self ::once ())->method ('getDefaultShipping ' )->willReturn ($ defaultAddressId );
136
- $ this ->addressMock ->expects (self ::once ())->method ('getCountryId ' )->willReturn ($ countryId );
137
- $ regionMock ->expects (self ::once ())->method ('getRegion ' )->willReturn ($ regionId );
138
- $ this ->addressMock ->expects (self ::once ())->method ('getRegion ' )->willReturn ($ regionMock );
139
- $ this ->addressRepositoryMock ->expects (self ::once ())->method ('getById ' )->with ($ defaultAddressId )->willReturn ($ this ->addressMock );
140
- $ this ->estimateAddressFactoryMock ->expects (self ::once ())->method ('create ' )->willReturn ($ this ->estimateAddressMock );
141
- $ this ->quoteRepositoryMock ->expects (self ::once ())->method ('save ' );
132
+ $ this ->customerSessionMock ->expects (self ::once ())
133
+ ->method ('isLoggedIn ' )
134
+ ->willReturn (true );
135
+ $ this ->customerSessionMock ->expects (self ::once ())
136
+ ->method ('getCustomerId ' )
137
+ ->willReturn ($ customerId );
138
+ $ this ->customerRepositoryMock ->expects (self ::once ())
139
+ ->method ('getById ' )
140
+ ->willReturn ($ this ->customerMock );
141
+ $ this ->customerMock ->expects (self ::once ())
142
+ ->method ('getDefaultShipping ' )
143
+ ->willReturn ($ defaultAddressId );
144
+ $ this ->addressMock ->expects (self ::once ())
145
+ ->method ('getCountryId ' )
146
+ ->willReturn ($ countryId );
147
+ $ regionMock ->expects (self ::once ())
148
+ ->method ('getRegion ' )
149
+ ->willReturn ($ regionId );
150
+ $ this ->addressMock ->expects (self ::once ())
151
+ ->method ('getRegion ' )
152
+ ->willReturn ($ regionMock );
153
+ $ this ->addressRepositoryMock ->expects (self ::once ())
154
+ ->method ('getById ' )
155
+ ->with ($ defaultAddressId )
156
+ ->willReturn ($ this ->addressMock );
157
+ $ this ->estimateAddressFactoryMock ->expects (self ::once ())
158
+ ->method ('create ' )
159
+ ->willReturn ($ this ->estimateAddressMock );
160
+ $ this ->quoteRepositoryMock ->expects (self ::once ())
161
+ ->method ('save ' );
142
162
143
163
$ this ->model ->collect ($ this ->quoteMock );
144
164
}
@@ -148,8 +168,11 @@ public function testCollect()
148
168
*/
149
169
public function testCustomerIsNotLoggedIn ()
150
170
{
151
- $ this ->customerSessionMock ->expects (self ::once ())->method ('isLoggedIn ' )->willReturn (false );
152
- $ this ->customerRepositoryMock ->expects (self ::never ())->method ('getById ' );
171
+ $ this ->customerSessionMock ->expects (self ::once ())
172
+ ->method ('isLoggedIn ' )
173
+ ->willReturn (false );
174
+ $ this ->customerRepositoryMock ->expects (self ::never ())
175
+ ->method ('getById ' );
153
176
154
177
$ this ->model ->collect ($ this ->quoteMock );
155
178
}
0 commit comments