diff --git a/tests/ScenarioTest.php b/tests/ScenarioTest.php index 99e5fda..9f58d34 100644 --- a/tests/ScenarioTest.php +++ b/tests/ScenarioTest.php @@ -14,12 +14,12 @@ expect($state) ->toBeInstanceOf(State::class) ->and($state->value)->toBe([MachineDefinition::DEFAULT_ID.MachineDefinition::STATE_DELIMITER.'test.stateC']) - ->and($state->context->count)->toBe(0); + ->and($state->context->count)->toBe(-1); $state = $machine->send('EVENT_D'); expect($state) ->toBeInstanceOf(State::class) ->and($state->value)->toBe([MachineDefinition::DEFAULT_ID.MachineDefinition::STATE_DELIMITER.'test.stateA']) - ->and($state->context->count)->toBe(-1); + ->and($state->context->count)->toBe(-2); }); diff --git a/tests/Stubs/Machines/MachineWithScenarios.php b/tests/Stubs/Machines/MachineWithScenarios.php index 3699686..b8b3c1b 100644 --- a/tests/Stubs/Machines/MachineWithScenarios.php +++ b/tests/Stubs/Machines/MachineWithScenarios.php @@ -65,6 +65,9 @@ public static function definition(): MachineDefinition ], ], 'stateC' => [ + 'entry' => [ + 'decrementAction', + ], 'on' => [ 'EVENT_D' => [ 'target' => 'stateA',