diff --git a/tests/StateDefinitionTypeTest.php b/tests/StateDefinitionTypeTest.php index 6a1c8ef..4a8301a 100644 --- a/tests/StateDefinitionTypeTest.php +++ b/tests/StateDefinitionTypeTest.php @@ -9,7 +9,6 @@ use Tarfinlabs\EventMachine\Enums\StateDefinitionType; use Tarfinlabs\EventMachine\Definition\MachineDefinition; use Tarfinlabs\EventMachine\Tests\Stubs\Results\GreenResult; -use Tarfinlabs\EventMachine\Exceptions\InvalidFinalStateDefinitionException; test('a state definition can be atomic', function (): void { $machine = MachineDefinition::define(config: [ @@ -96,44 +95,6 @@ '@green', ]); -test('a final state definition can not have child states', function (): void { - MachineDefinition::define(config: [ - 'initial' => 'yellow', - 'states' => [ - 'yellow' => [ - 'type' => 'final', - 'states' => [ - 'a' => [], - 'b' => [], - ], - ], - ], - ]); -})->throws( - exception: InvalidFinalStateDefinitionException::class, - exceptionMessage: 'The final state `machine.yellow` should not have child states. Please revise your state machine definitions to ensure that final states are correctly configured without child states.' -); - -test('a final state definition can not have transitions', function (): void { - MachineDefinition::define(config: [ - 'initial' => 'yellow', - 'states' => [ - 'yellow' => [ - 'type' => 'final', - 'on' => [ - 'EVENT' => [ - 'target' => 'red', - ], - ], - ], - 'red' => [], - ], - ]); -})->throws( - exception: InvalidFinalStateDefinitionException::class, - exceptionMessage: 'The final state `machine.yellow` should not have transitions. Check your state machine configuration to ensure events are not dispatched when in a final state.' -); - test('an initial state of type final triggers machine finish event', function (): void { $machine = Machine::create(definition: [ 'config' => [