@@ -115,7 +115,9 @@ public function testReindexWithoutArgumentsExecutesReindexAll()
115
115
116
116
public function testReindexWithNotNullArgumentExecutesReindexEntities ()
117
117
{
118
- $ ids = [1 , 2 , 3 ];
118
+ $ childIds = [1 , 2 , 3 ];
119
+ $ parentIds = [4 ];
120
+ $ reindexIds = array_merge ($ childIds , $ parentIds );
119
121
$ connectionMock = $ this ->getMockBuilder (\Magento \Framework \DB \Adapter \AdapterInterface::class)
120
122
->getMockForAbstractClass ();
121
123
@@ -127,21 +129,21 @@ public function testReindexWithNotNullArgumentExecutesReindexEntities()
127
129
->disableOriginalConstructor ()
128
130
->getMock ();
129
131
130
- $ eavSource ->expects ($ this ->once ())->method ('getRelationsByChild ' )->with ($ ids )->willReturn ([] );
131
- $ eavSource ->expects ($ this ->once ())->method ('getRelationsByParent ' )->with ($ ids )->willReturn ([] );
132
+ $ eavSource ->expects ($ this ->once ())->method ('getRelationsByChild ' )->with ($ childIds )->willReturn ($ childIds );
133
+ $ eavSource ->expects ($ this ->once ())->method ('getRelationsByParent ' )->with ($ childIds )->willReturn ($ parentIds );
132
134
133
- $ eavDecimal ->expects ($ this ->once ())->method ('getRelationsByChild ' )->with ($ ids )->willReturn ([] );
134
- $ eavDecimal ->expects ($ this ->once ())->method ('getRelationsByParent ' )->with ($ ids )->willReturn ([]);
135
+ $ eavDecimal ->expects ($ this ->once ())->method ('getRelationsByChild ' )->with ($ reindexIds )->willReturn ($ reindexIds );
136
+ $ eavDecimal ->expects ($ this ->once ())->method ('getRelationsByParent ' )->with ($ reindexIds )->willReturn ([]);
135
137
136
138
$ eavSource ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ($ connectionMock );
137
139
$ eavDecimal ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ($ connectionMock );
138
140
$ eavDecimal ->expects ($ this ->once ())
139
141
->method ('reindexEntities ' )
140
- ->with ($ ids );
142
+ ->with ($ reindexIds );
141
143
142
144
$ eavSource ->expects ($ this ->once ())
143
145
->method ('reindexEntities ' )
144
- ->with ($ ids );
146
+ ->with ($ reindexIds );
145
147
146
148
$ this ->_eavSourceFactoryMock ->expects ($ this ->once ())
147
149
->method ('create ' )
@@ -151,6 +153,6 @@ public function testReindexWithNotNullArgumentExecutesReindexEntities()
151
153
->method ('create ' )
152
154
->will ($ this ->returnValue ($ eavDecimal ));
153
155
154
- $ this ->_model ->reindex ($ ids );
156
+ $ this ->_model ->reindex ($ childIds );
155
157
}
156
158
}
0 commit comments