new LineItem('A', 'test', null, 3
))->
setGood(true
)->
assign(['uniqueIdentifier' => 'A'
]),
(new LineItem('B', 'test', null, 3
))->
setGood(false
)->
assign(['uniqueIdentifier' => 'B'
]),
(new LineItem('C', 'test', null, 3
))->
setGood(false
)->
assign(['uniqueIdentifier' => 'C'
]),
(new LineItem('D', 'test', null, 3
))->
setGood(true
)->
assign(['uniqueIdentifier' => 'D'
]),
]);
static::
assertEquals( new LineItemCollection([ (new LineItem('A', 'test', null, 3
))->
setGood(true
)->
assign(['uniqueIdentifier' => 'A'
]),
(new LineItem('D', 'test', null, 3
))->
setGood(true
)->
assign(['uniqueIdentifier' => 'D'
]),
]),
$collection->
filterGoods() );
} public function testFilterGoodsReturnsNewCollection(): void
{ $collection =
new LineItemCollection([ (new LineItem('A', 'test', null, 3
))->
setGood(true
),
(new LineItem('B', 'test', null, 3
))->
setGood(true
),
(new LineItem('C', 'test', null, 3
))->
setGood(true
),
(new LineItem('D', 'test', null, 3
))->
setGood(true
),
]);