@@ -70,7 +70,9 @@ protected function setUp()
70
70
'getAddressById ' ,
71
71
'getBillingAddress ' ,
72
72
'getShippingAddress ' ,
73
- '__wakeup ' ],
73
+ '__wakeup ' ,
74
+ 'getCustomerId '
75
+ ],
74
76
[],
75
77
'' ,
76
78
false );
@@ -114,6 +116,7 @@ protected function setUp()
114
116
'setSender ' ,
115
117
'setRecipient ' ,
116
118
'setMessage ' ,
119
+ 'setCustomerId ' ,
117
120
'getSender ' ,
118
121
'getRecipient ' ,
119
122
'getMessage ' ,
@@ -182,6 +185,7 @@ public function testAddWithSaveMessageIdException()
182
185
],
183
186
],
184
187
];
188
+ $ customerId = 42 ;
185
189
186
190
$ this ->messageFactoryMock ->expects ($ this ->once ())
187
191
->method ('create ' )
@@ -199,6 +203,11 @@ public function testAddWithSaveMessageIdException()
199
203
->method ('setRecipient ' )
200
204
->with ('recipient ' )
201
205
->will ($ this ->returnValue ($ this ->giftMessageMock ));
206
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getCustomerId ' )->willReturn ($ customerId );
207
+ $ this ->giftMessageMock ->expects ($ this ->once ())
208
+ ->method ('setCustomerId ' )
209
+ ->with ($ customerId )
210
+ ->will ($ this ->returnValue ($ this ->giftMessageMock ));
202
211
$ this ->giftMessageMock ->expects ($ this ->once ())
203
212
->method ('setMessage ' )
204
213
->with ('message ' )
@@ -227,6 +236,7 @@ public function testAddWithQuoteAddress()
227
236
],
228
237
],
229
238
];
239
+ $ customerId = 42 ;
230
240
231
241
$ this ->messageFactoryMock ->expects ($ this ->once ())
232
242
->method ('create ' )
@@ -248,6 +258,11 @@ public function testAddWithQuoteAddress()
248
258
->method ('setMessage ' )
249
259
->with ('message ' )
250
260
->will ($ this ->returnValue ($ this ->giftMessageMock ));
261
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getCustomerId ' )->willReturn ($ customerId );
262
+ $ this ->giftMessageMock ->expects ($ this ->once ())
263
+ ->method ('setCustomerId ' )
264
+ ->with ($ customerId )
265
+ ->will ($ this ->returnValue ($ this ->giftMessageMock ));
251
266
$ this ->giftMessageMock ->expects ($ this ->once ())->method ('save ' );
252
267
$ this ->giftMessageMock ->expects ($ this ->once ())->method ('getId ' )->will ($ this ->returnValue (33 ));
253
268
$ this ->quoteAddressMock ->expects ($ this ->once ())
@@ -271,6 +286,7 @@ public function testAddWithQuoteAddressItem()
271
286
],
272
287
],
273
288
];
289
+ $ customerId = 42 ;
274
290
275
291
$ this ->messageFactoryMock ->expects ($ this ->once ())
276
292
->method ('create ' )
@@ -296,6 +312,11 @@ public function testAddWithQuoteAddressItem()
296
312
->method ('setMessage ' )
297
313
->with ('message ' )
298
314
->will ($ this ->returnValue ($ this ->giftMessageMock ));
315
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getCustomerId ' )->willReturn ($ customerId );
316
+ $ this ->giftMessageMock ->expects ($ this ->once ())
317
+ ->method ('setCustomerId ' )
318
+ ->with ($ customerId )
319
+ ->will ($ this ->returnValue ($ this ->giftMessageMock ));
299
320
$ this ->giftMessageMock ->expects ($ this ->once ())->method ('save ' );
300
321
$ this ->giftMessageMock ->expects ($ this ->once ())->method ('getId ' )->will ($ this ->returnValue (33 ));
301
322
$ this ->quoteAddressItemMock ->expects ($ this ->once ())
0 commit comments