fix CartControllerCest
This commit is contained in:
parent
1825ac9d76
commit
643264ca90
|
|
@ -15,26 +15,30 @@ class CartControllerCest
|
|||
* @param \Example $scenario
|
||||
*
|
||||
* @throws \Exception
|
||||
* @dataProvider getOnWarningAddingToCartScenarios
|
||||
* @dataProvider getOnFailureAddingToCartScenarios
|
||||
*/
|
||||
public function testOnWarningAddingToCart(UnitTester $I, Example $scenario): void
|
||||
public function testOnFailureAddingToCart(UnitTester $I, Example $scenario): void
|
||||
{
|
||||
$I->assertEquals($scenario['expected'],
|
||||
$I->executeFunction(
|
||||
CartController::class,
|
||||
'onWarningAddingToCart',
|
||||
'onFailureAddingToCart',
|
||||
[$scenario['result']]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function getOnWarningAddingToCartScenarios(): array
|
||||
protected function getOnFailureAddingToCartScenarios(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'result' => ['key' => 'value', 'warning' => 'Hello World. Something went wrong.'],
|
||||
'expected' => true,
|
||||
],
|
||||
[
|
||||
'result' => ['key' => 'value', 'info' => 'This is only a test.'],
|
||||
'expected' => true,
|
||||
],
|
||||
[
|
||||
'result' => ['key' => 'value'],
|
||||
'expected' => false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue