@@ -78,10 +78,13 @@ public function testModifyPrice(): void
78
78
$ entityIds = [1 , 2 , 3 ];
79
79
$ indexTableStructure = $ this ->createMock (IndexTableStructure::class);
80
80
$ connectionMock = $ this ->getMockForAbstractClass (AdapterInterface::class);
81
- $ this ->resourceConnection ->expects ($ this ->exactly ( 6 ))->method ('getConnection ' )->willReturn ($ connectionMock );
81
+ $ this ->resourceConnection ->expects ($ this ->once ( ))->method ('getConnection ' )->willReturn ($ connectionMock );
82
82
$ selectMock = $ this ->createMock (Select::class);
83
- $ connectionMock ->expects ($ this ->exactly (6 ))->method ('select ' )->willReturn ($ selectMock );
84
-
83
+ $ connectionMock ->expects ($ this ->once ())->method ('select ' )->willReturn ($ selectMock );
84
+ $ selectMock
85
+ ->method ('where ' )
86
+ ->withConsecutive ([], [], ['stock_item.product_id IN (?) ' , $ entityIds ])
87
+ ->willReturnOnConsecutiveCalls (null , null , $ selectMock );
85
88
$ this ->generator ->expects ($ this ->once ())
86
89
->method ('generate ' )
87
90
->willReturnCallback (
@@ -96,33 +99,6 @@ public function testModifyPrice(): void
96
99
$ this ->productPriceIndexFilter ->modifyPrice ($ indexTableStructure , $ entityIds );
97
100
}
98
101
99
- public function testModifyPriceDynamicPriceBundle (): void
100
- {
101
- $ indexTableStructure = $ this ->createMock (IndexTableStructure::class);
102
- $ indexTableStructure ->expects ($ this ->any ())->method ('getTableName ' )
103
- ->willReturn ('price_table ' );
104
- $ this ->stockConfiguration ->expects ($ this ->once ())->method ('isShowOutOfStock ' )->willReturn (false );
105
- $ connectionMock = $ this ->getMockForAbstractClass (AdapterInterface::class);
106
- $ this ->resourceConnection ->expects ($ this ->exactly (2 ))->method ('getConnection ' )->willReturn ($ connectionMock );
107
-
108
- $ selectMock = $ this ->createMock (Select::class);
109
- $ connectionMock ->expects ($ this ->exactly (2 ))->method ('select ' )->willReturn ($ selectMock );
110
- $ this ->generator ->expects ($ this ->once ())
111
- ->method ('generate ' )
112
- ->willReturnCallback (
113
- $ this ->getBatchIteratorCallback ($ selectMock , 1 )
114
- );
115
- $ fetchStmtMock = $ this ->createPartialMock (\Zend_Db_Statement_Pdo::class, ['fetchAll ' ]);
116
- $ fetchStmtMock ->expects ($ this ->any ())
117
- ->method ('fetchAll ' )
118
- ->willReturn ([['product_id ' => 1 ]]);
119
- $ connectionMock ->expects ($ this ->any ())->method ('query ' )->willReturn ($ fetchStmtMock );
120
- $ connectionMock ->expects ($ this ->once ())->method ('fetchOne ' )->willReturn (1 );
121
- $ connectionMock ->expects ($ this ->once ())->method ('delete ' )->with ('price_table ' , [' IN (?) ' => [1 ]]);
122
-
123
- $ this ->productPriceIndexFilter ->modifyPrice ($ indexTableStructure );
124
- }
125
-
126
102
/**
127
103
* Returns batches.
128
104
*
0 commit comments