@@ -77,11 +77,6 @@ class ProductRepositoryTest extends TestCase
77
77
*/
78
78
private $ model ;
79
79
80
- /**
81
- * @var Helper|MockObject
82
- */
83
- private $ initializationHelper ;
84
-
85
80
/**
86
81
* @var Product|MockObject
87
82
*/
@@ -255,7 +250,6 @@ protected function setUp(): void
255
250
->method ('hasGalleryAttribute ' )
256
251
->willReturn (true );
257
252
$ this ->filterBuilder = $ this ->createMock (FilterBuilder::class);
258
- $ this ->initializationHelper = $ this ->createMock (Helper::class);
259
253
$ this ->collectionFactory = $ this ->createPartialMock (CollectionFactory::class, ['create ' ]);
260
254
$ this ->searchCriteriaBuilder = $ this ->createMock (SearchCriteriaBuilder::class);
261
255
$ this ->metadataService = $ this ->getMockForAbstractClass (ProductAttributeRepositoryInterface::class);
@@ -342,7 +336,6 @@ function ($value) {
342
336
ProductRepository::class,
343
337
[
344
338
'productFactory ' => $ this ->productFactory ,
345
- 'initializationHelper ' => $ this ->initializationHelper ,
346
339
'resourceModel ' => $ this ->resourceModel ,
347
340
'filterBuilder ' => $ this ->filterBuilder ,
348
341
'collectionFactory ' => $ this ->collectionFactory ,
@@ -723,7 +716,6 @@ public function testSaveExisting(): void
723
716
$ this ->productFactory ->expects ($ this ->any ())
724
717
->method ('create ' )
725
718
->willReturn ($ this ->product );
726
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
727
719
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
728
720
->willReturn (true );
729
721
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
@@ -748,7 +740,6 @@ public function testSaveNew(): void
748
740
$ this ->productFactory ->expects ($ this ->any ())
749
741
->method ('create ' )
750
742
->willReturn ($ this ->product );
751
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
752
743
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
753
744
->willReturn (true );
754
745
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
@@ -774,7 +765,6 @@ public function testSaveUnableToSaveException(): void
774
765
$ this ->productFactory ->expects ($ this ->exactly (2 ))
775
766
->method ('create ' )
776
767
->willReturn ($ this ->product );
777
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
778
768
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
779
769
->willReturn (true );
780
770
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )
@@ -800,7 +790,6 @@ public function testSaveException(): void
800
790
$ this ->productFactory ->expects ($ this ->exactly (2 ))
801
791
->method ('create ' )
802
792
->willReturn ($ this ->product );
803
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
804
793
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
805
794
->willReturn (true );
806
795
@@ -830,7 +819,6 @@ public function testSaveInvalidProductException(): void
830
819
$ this ->productFactory ->expects ($ this ->exactly (2 ))
831
820
->method ('create ' )
832
821
->willReturn ($ this ->product );
833
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
834
822
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
835
823
->willReturn (['error1 ' , 'error2 ' ]);
836
824
$ this ->product ->expects ($ this ->once ())->method ('getId ' )->willReturn (null );
@@ -854,8 +842,6 @@ public function testSaveThrowsTemporaryStateExceptionIfDatabaseConnectionErrorOc
854
842
$ this ->productFactory ->expects ($ this ->any ())
855
843
->method ('create ' )
856
844
->willReturn ($ this ->product );
857
- $ this ->initializationHelper ->expects ($ this ->never ())
858
- ->method ('initialize ' );
859
845
$ this ->resourceModel ->expects ($ this ->once ())
860
846
->method ('validate ' )
861
847
->with ($ this ->product )
@@ -1018,7 +1004,6 @@ public function testSaveExistingWithOptions(array $newOptions): void
1018
1004
$ this ->productFactory ->expects ($ this ->any ())
1019
1005
->method ('create ' )
1020
1006
->willReturn ($ this ->initializedProduct );
1021
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
1022
1007
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
1023
1008
->willReturn (true );
1024
1009
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1184,7 +1169,6 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $
1184
1169
$ this ->productFactory ->expects ($ this ->any ())
1185
1170
->method ('create ' )
1186
1171
->willReturn ($ this ->initializedProduct );
1187
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
1188
1172
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
1189
1173
->willReturn (true );
1190
1174
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1354,7 +1338,6 @@ protected function setupProductMocksForSave(): void
1354
1338
$ this ->productFactory ->expects ($ this ->any ())
1355
1339
->method ('create ' )
1356
1340
->willReturn ($ this ->initializedProduct );
1357
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
1358
1341
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
1359
1342
->willReturn (true );
1360
1343
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1475,7 +1458,6 @@ public function testSaveWithDifferentWebsites(): void
1475
1458
$ this ->productFactory ->expects ($ this ->any ())
1476
1459
->method ('create ' )
1477
1460
->willReturn ($ this ->product );
1478
- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
1479
1461
$ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
1480
1462
->willReturn (true );
1481
1463
$ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
0 commit comments