From bf66715227486695b688d5cedf73006b1c328f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunus=20Emre=20Delig=C3=B6z?= Date: Tue, 5 Dec 2023 01:58:48 +0300 Subject: [PATCH] test: fix (WEB-4344) --- tests/Stubs/Guards/IsOddGuard.php | 14 ++++++-------- tests/Stubs/Machines/Asd/Actions/DAction.php | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/Stubs/Guards/IsOddGuard.php b/tests/Stubs/Guards/IsOddGuard.php index 1f049792..e9f2ba49 100644 --- a/tests/Stubs/Guards/IsOddGuard.php +++ b/tests/Stubs/Guards/IsOddGuard.php @@ -4,8 +4,7 @@ namespace Tarfinlabs\EventMachine\Tests\Stubs\Guards; -use Tarfinlabs\EventMachine\ContextManager; -use Tarfinlabs\EventMachine\Behavior\EventBehavior; +use Closure; use Tarfinlabs\EventMachine\Behavior\GuardBehavior; use Tarfinlabs\EventMachine\Tests\Stubs\Machines\TrafficLights\TrafficLightsContext; @@ -15,11 +14,10 @@ class IsOddGuard extends GuardBehavior 'counts.oddCount' => 'integer', ]; - public function __invoke( - TrafficLightsContext|ContextManager $context, - EventBehavior $eventBehavior, - array $arguments = null - ): bool { - return $context->count % 2 === 1; + public function definition(): Closure + { + return function (TrafficLightsContext $context) { + return $context->count % 2 === 1; + }; } } diff --git a/tests/Stubs/Machines/Asd/Actions/DAction.php b/tests/Stubs/Machines/Asd/Actions/DAction.php index 0f2eb8e6..a90f06f5 100644 --- a/tests/Stubs/Machines/Asd/Actions/DAction.php +++ b/tests/Stubs/Machines/Asd/Actions/DAction.php @@ -5,7 +5,7 @@ namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Asd\Actions; use Closure; -use Exception; +use RuntimeException; use Tarfinlabs\EventMachine\Behavior\ActionBehavior; class DAction extends ActionBehavior @@ -13,7 +13,7 @@ class DAction extends ActionBehavior public function definition(): Closure { return function (): void { - throw new Exception('error'); + throw new RuntimeException('error'); }; } }