Skip to content

Commit

Permalink
test: Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
aydinfatih committed Nov 20, 2023
1 parent f3d4b7b commit 35237a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ScenarioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
3 changes: 3 additions & 0 deletions tests/Stubs/Machines/MachineWithScenarios.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public static function definition(): MachineDefinition
],
],
'stateC' => [
'entry' => [
'decrementAction',
],
'on' => [
'EVENT_D' => [
'target' => 'stateA',
Expand Down

0 comments on commit 35237a5

Please sign in to comment.