static::
assertCount(0,
$collection);
} /**
* @dataProvider lineItemStateProvider
*
* @param array<string, bool> $expectedResults
*/
public function testHasLineItemWithState(LineItemCollection
$collection, array
$expectedResults): void
{ foreach ($expectedResults as $state =>
$expected) { static::
assertSame($expected,
$collection->
hasLineItemWithState($state), 'Line item of state `' .
$state . '` could not be found.'
);
} } public static function lineItemStateProvider(): \Generator
{ yield 'collection has line item with state download and physical' =>
[ new LineItemCollection([ (new LineItem('A', 'test'
))->
setStates([State::IS_PHYSICAL
]),
(new LineItem('B', 'test'
))->
setStates([State::IS_DOWNLOAD
]),
]),
[State::IS_PHYSICAL => true, State::IS_DOWNLOAD => true
],
];