This is my data provider function:
public function addDataProvider() {
return [
[
[
'currency' => 'eur',
'amount' => 800,
],
[
'currency' => '12312k',
'amount' => 1201,
],
[
'currency' => 'DKK',
'amount' => 1200.01
],
[
'currency' => 'SEK ',
'amount' => 1200.01
]
],
];
}
This is my test function:
/**
* Test case
* @covers AmountPerCustomer::checkAmounts()
* @dataProvider addDataProvider
*/
public function testCheckAmountUsingCurrency($query)
{
....
try {
$ordersPerCustomer->checkAmounts($query['amount'], $query['currency'], $dateInterval);
$this->fail("Expected Exception has not been raised.");
}catch (\Exception $error) {
$this->assertEquals($error->getMessage(), "Total order amount event given parameters exceed sum {$query['amount']} since {$dateInterval->format('H:i d-m-Y')} from source {$source}");
}
}
I am getting this success mesage: OK (1 test, 1 assertion)
, My question why I have only one assertion. I have multiple array values in my provider . What am I doing wrong ?
Thank you!