@@ -160,7 +160,7 @@ protected function setUp()
160
160
false
161
161
);
162
162
$ this ->customer = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
163
- ->setMethods (['__toArray ' ])
163
+ ->setMethods (['__toArray ' , ' setGroupId ' ])
164
164
->disableOriginalConstructor ()
165
165
->getMockForAbstractClass ();
166
166
$ this ->model = new \Magento \Customer \Model \ResourceModel \CustomerRepository (
@@ -187,6 +187,7 @@ public function testSave()
187
187
{
188
188
$ customerId = 1 ;
189
189
$ storeId = 2 ;
190
+ $ groupId = 1 ;
190
191
191
192
$ region = $ this ->getMockForAbstractClass (\Magento \Customer \Api \Data \RegionInterface::class, [], '' , false );
192
193
$ address = $ this ->getMockForAbstractClass (
@@ -222,6 +223,7 @@ public function testSave()
222
223
[
223
224
'getId ' ,
224
225
'setId ' ,
226
+ 'setGroupId ' ,
225
227
'setStoreId ' ,
226
228
'getStoreId ' ,
227
229
'getAttributeSetId ' ,
@@ -254,7 +256,8 @@ public function testSave()
254
256
'getEmail ' ,
255
257
'getWebsiteId ' ,
256
258
'getAddresses ' ,
257
- 'setAddresses '
259
+ 'setAddresses ' ,
260
+ 'getGroupId '
258
261
]
259
262
);
260
263
$ customerSecureData = $ this ->getMock (
@@ -289,6 +292,17 @@ public function testSave()
289
292
->method ('setCustomerId ' )
290
293
->with ($ customerId )
291
294
->willReturnSelf ();
295
+
296
+ $ this ->customer ->expects ($ this ->exactly (2 ))
297
+ ->method ('getGroupId ' )
298
+ ->willReturn ($ groupId );
299
+ $ customerAttributesMetaData ->expects ($ this ->once ())
300
+ ->method ('getGroupId ' )
301
+ ->willReturn (null );
302
+ $ customerModel ->expects ($ this ->once ())
303
+ ->method ('setGroupId ' )
304
+ ->with ($ groupId );
305
+
292
306
$ address ->expects ($ this ->once ())
293
307
->method ('getRegion ' )
294
308
->willReturn ($ region );
0 commit comments