@@ -155,7 +155,6 @@ private function getOrder(string $incrementId): OrderInterface
155
155
*/
156
156
public function testGetTracksCollection ()
157
157
{
158
- $ trackCount = 1 ;
159
158
$ order = $ this ->getOrder ('100000001 ' );
160
159
$ items = [];
161
160
foreach ($ order ->getItems () as $ item ) {
@@ -197,25 +196,10 @@ public function testGetTracksCollection()
197
196
$ this ->shipmentRepository ->save ($ secondOrderShipment );
198
197
$ secondShipmentTrackCollection = $ secondOrderShipment ->getTracksCollection ();
199
198
200
- $ shipmentId = $ shipment ->getId ();
201
- $ shipmentTrackIds = $ shipmentTracksCollection ->getColumnValues ('parent_id ' );
202
- foreach ($ shipmentTrackIds as $ trackShipmentId ) {
203
- self ::assertEquals ($ shipmentId , $ trackShipmentId );
204
- }
205
- self ::assertCount ($ trackCount , $ shipmentTrackIds );
206
-
207
- $ secondShipmentId = $ secondOrderShipment ->getId ();
208
- $ secondShipmentTrackIds = $ secondShipmentTrackCollection ->getColumnValues ('parent_id ' );
209
- foreach ($ secondShipmentTrackIds as $ trackShipmentId ) {
210
- self ::assertEquals ($ secondShipmentId , $ trackShipmentId );
211
- }
212
- self ::assertCount ($ trackCount , $ secondShipmentTrackIds );
213
-
214
- self ::assertEmpty (
215
- array_intersect (
216
- $ shipmentTracksCollection ->getColumnValues ('id ' ),
217
- $ secondShipmentTrackCollection ->getColumnValues ('id ' )
218
- )
199
+ self ::assertEquals ($ shipmentTracksCollection ->getColumnValues ('id ' ), [$ track ->getEntityId ()]);
200
+ self ::assertEquals (
201
+ $ secondShipmentTrackCollection ->getColumnValues ('id ' ),
202
+ [$ secondShipmentTrack ->getEntityId ()]
219
203
);
220
204
}
221
205
}
0 commit comments