@@ -77,11 +77,6 @@ class ProductRepositoryTest extends TestCase
7777 */
7878 private $ model ;
7979
80- /**
81- * @var Helper|MockObject
82- */
83- private $ initializationHelper ;
84-
8580 /**
8681 * @var Product|MockObject
8782 */
@@ -255,7 +250,6 @@ protected function setUp(): void
255250 ->method ('hasGalleryAttribute ' )
256251 ->willReturn (true );
257252 $ this ->filterBuilder = $ this ->createMock (FilterBuilder::class);
258- $ this ->initializationHelper = $ this ->createMock (Helper::class);
259253 $ this ->collectionFactory = $ this ->createPartialMock (CollectionFactory::class, ['create ' ]);
260254 $ this ->searchCriteriaBuilder = $ this ->createMock (SearchCriteriaBuilder::class);
261255 $ this ->metadataService = $ this ->getMockForAbstractClass (ProductAttributeRepositoryInterface::class);
@@ -342,7 +336,6 @@ function ($value) {
342336 ProductRepository::class,
343337 [
344338 'productFactory ' => $ this ->productFactory ,
345- 'initializationHelper ' => $ this ->initializationHelper ,
346339 'resourceModel ' => $ this ->resourceModel ,
347340 'filterBuilder ' => $ this ->filterBuilder ,
348341 'collectionFactory ' => $ this ->collectionFactory ,
@@ -723,7 +716,6 @@ public function testSaveExisting(): void
723716 $ this ->productFactory ->expects ($ this ->any ())
724717 ->method ('create ' )
725718 ->willReturn ($ this ->product );
726- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
727719 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
728720 ->willReturn (true );
729721 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
@@ -748,7 +740,6 @@ public function testSaveNew(): void
748740 $ this ->productFactory ->expects ($ this ->any ())
749741 ->method ('create ' )
750742 ->willReturn ($ this ->product );
751- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
752743 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
753744 ->willReturn (true );
754745 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
@@ -774,7 +765,6 @@ public function testSaveUnableToSaveException(): void
774765 $ this ->productFactory ->expects ($ this ->exactly (2 ))
775766 ->method ('create ' )
776767 ->willReturn ($ this ->product );
777- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
778768 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
779769 ->willReturn (true );
780770 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )
@@ -800,7 +790,6 @@ public function testSaveException(): void
800790 $ this ->productFactory ->expects ($ this ->exactly (2 ))
801791 ->method ('create ' )
802792 ->willReturn ($ this ->product );
803- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
804793 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
805794 ->willReturn (true );
806795
@@ -830,7 +819,6 @@ public function testSaveInvalidProductException(): void
830819 $ this ->productFactory ->expects ($ this ->exactly (2 ))
831820 ->method ('create ' )
832821 ->willReturn ($ this ->product );
833- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
834822 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
835823 ->willReturn (['error1 ' , 'error2 ' ]);
836824 $ this ->product ->expects ($ this ->once ())->method ('getId ' )->willReturn (null );
@@ -854,8 +842,6 @@ public function testSaveThrowsTemporaryStateExceptionIfDatabaseConnectionErrorOc
854842 $ this ->productFactory ->expects ($ this ->any ())
855843 ->method ('create ' )
856844 ->willReturn ($ this ->product );
857- $ this ->initializationHelper ->expects ($ this ->never ())
858- ->method ('initialize ' );
859845 $ this ->resourceModel ->expects ($ this ->once ())
860846 ->method ('validate ' )
861847 ->with ($ this ->product )
@@ -1018,7 +1004,6 @@ public function testSaveExistingWithOptions(array $newOptions): void
10181004 $ this ->productFactory ->expects ($ this ->any ())
10191005 ->method ('create ' )
10201006 ->willReturn ($ this ->initializedProduct );
1021- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
10221007 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
10231008 ->willReturn (true );
10241009 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1184,7 +1169,6 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $
11841169 $ this ->productFactory ->expects ($ this ->any ())
11851170 ->method ('create ' )
11861171 ->willReturn ($ this ->initializedProduct );
1187- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
11881172 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
11891173 ->willReturn (true );
11901174 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1354,7 +1338,6 @@ protected function setupProductMocksForSave(): void
13541338 $ this ->productFactory ->expects ($ this ->any ())
13551339 ->method ('create ' )
13561340 ->willReturn ($ this ->initializedProduct );
1357- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
13581341 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->initializedProduct )
13591342 ->willReturn (true );
13601343 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )
@@ -1475,7 +1458,6 @@ public function testSaveWithDifferentWebsites(): void
14751458 $ this ->productFactory ->expects ($ this ->any ())
14761459 ->method ('create ' )
14771460 ->willReturn ($ this ->product );
1478- $ this ->initializationHelper ->expects ($ this ->never ())->method ('initialize ' );
14791461 $ this ->resourceModel ->expects ($ this ->once ())->method ('validate ' )->with ($ this ->product )
14801462 ->willReturn (true );
14811463 $ this ->resourceModel ->expects ($ this ->once ())->method ('save ' )->with ($ this ->product )->willReturn (true );
0 commit comments