@@ -129,15 +129,15 @@ protected function setUp(): void
129129 * @param bool $processedFlag
130130 * @param bool $forceProcess
131131 * @param int $addressId
132- * @param int $registeredAddressId
133- * @param string $configAddressType
132+ * @param mixed $registeredAddressId
133+ * @param mixed $configAddressType
134134 * @dataProvider dataProviderAfterAddressSaveRestricted
135135 */
136136 public function testAfterAddressSaveRestricted (
137- $ isVatValidationEnabled ,
138- $ processedFlag ,
139- $ forceProcess ,
140- $ addressId ,
137+ bool $ isVatValidationEnabled ,
138+ bool $ processedFlag ,
139+ bool $ forceProcess ,
140+ int $ addressId ,
141141 $ registeredAddressId ,
142142 $ configAddressType
143143 ) {
@@ -303,17 +303,21 @@ public function testAfterAddressSaveException()
303303 }
304304
305305 /**
306- * @param string $vatId
306+ * @param mixed $vatId
307307 * @param int $countryId
308308 * @param bool $isCountryInEU
309+ * @param int $customerGroupId
309310 * @param int $defaultGroupId
311+ * @param bool $disableAutoGroupChange
310312 * @dataProvider dataProviderAfterAddressSaveDefaultGroup
311313 */
312314 public function testAfterAddressSaveDefaultGroup (
313315 $ vatId ,
314- $ countryId ,
315- $ isCountryInEU ,
316- $ defaultGroupId
316+ int $ countryId ,
317+ bool $ isCountryInEU ,
318+ int $ customerGroupId ,
319+ int $ defaultGroupId ,
320+ bool $ disableAutoGroupChange
317321 ) {
318322 $ store = $ this ->getMockBuilder (Store::class)
319323 ->disableOriginalConstructor ()
@@ -340,15 +344,15 @@ public function testAfterAddressSaveDefaultGroup(
340344 ->willReturn ($ store );
341345 $ customer ->expects ($ this ->once ())
342346 ->method ('getDisableAutoGroupChange ' )
343- ->willReturn (false );
344- $ customer ->expects ($ this ->exactly ( 2 ))
347+ ->willReturn ($ disableAutoGroupChange );
348+ $ customer ->expects ($ this ->any ( ))
345349 ->method ('getGroupId ' )
346- ->willReturn (null );
347- $ customer ->expects ($ this ->once ())
350+ ->willReturn ($ customerGroupId );
351+ $ customer ->expects ($ this ->any ())
348352 ->method ('setGroupId ' )
349353 ->with ($ defaultGroupId )
350354 ->willReturnSelf ();
351- $ customer ->expects ($ this ->once ())
355+ $ customer ->expects ($ this ->any ())
352356 ->method ('save ' )
353357 ->willReturnSelf ();
354358
@@ -408,14 +412,17 @@ public function testAfterAddressSaveDefaultGroup(
408412 public function dataProviderAfterAddressSaveDefaultGroup ()
409413 {
410414 return [
411- ['' , 1 , false , 1 ],
412- [1 , 1 , false , 1 ],
415+ 'when vatId is empty, non EU country and disable auto group false ' => ['' , 1 , false , 1 , 1 , false ],
416+ 'when vatId is empty, non EU country and disable auto group true ' => ['' , 1 , false , 1 , 1 , true ],
417+ 'when vatId is empty, non EU country, disable auto group true
418+ and different groupId ' => ['' , 1 , false , 1 , 2 , true ],
419+ 'when vatId is not empty, non EU country and disable auto group false ' => [1 , 1 , false , 1 , 1 , false ],
413420 ];
414421 }
415422
416423 /**
417- * @param string $vatId
418- * @param $vatClass
424+ * @param mixed $vatId
425+ * @param mixed $vatClass
419426 * @param int $countryId
420427 * @param string $country
421428 * @param int $newGroupId
@@ -432,15 +439,15 @@ public function dataProviderAfterAddressSaveDefaultGroup()
432439 public function testAfterAddressSaveNewGroup (
433440 $ vatId ,
434441 $ vatClass ,
435- $ countryId ,
436- $ country ,
437- $ newGroupId ,
438- $ areaCode ,
439- $ resultVatIsValid ,
440- $ resultRequestSuccess ,
441- $ resultValidMessage ,
442- $ resultInvalidMessage ,
443- $ resultErrorMessage
442+ int $ countryId ,
443+ string $ country ,
444+ int $ newGroupId ,
445+ string $ areaCode ,
446+ bool $ resultVatIsValid ,
447+ bool $ resultRequestSuccess ,
448+ string $ resultValidMessage ,
449+ string $ resultInvalidMessage ,
450+ string $ resultErrorMessage
444451 ) {
445452 $ store = $ this ->getMockBuilder (Store::class)
446453 ->disableOriginalConstructor ()
0 commit comments