From fda5cc1b0b969494eaac77ec1b5678585197d0d0 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Wed, 10 Jan 2024 12:20:46 +0200 Subject: [PATCH] Add EntityBehaviorBootloader --- composer.json | 3 ++- src/Bootloader/EntityBehaviorBootloader.php | 19 +++++++++++++++++++ tests/src/BaseTest.php | 4 ++++ .../EntityBehaviorBootloaderTest.php | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/Bootloader/EntityBehaviorBootloader.php create mode 100644 tests/src/Bootloader/EntityBehaviorBootloaderTest.php diff --git a/composer.json b/composer.json index 17a23e0..6c44000 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,8 @@ "spiral/validator": "^1.5", "spiral/nyholm-bridge": "^1.3", "spiral-packages/database-seeder": "^3.1", - "vimeo/psalm": "^4.27" + "vimeo/psalm": "^4.27", + "cycle/entity-behavior": "^1.2" }, "autoload": { "psr-4": { diff --git a/src/Bootloader/EntityBehaviorBootloader.php b/src/Bootloader/EntityBehaviorBootloader.php new file mode 100644 index 0000000..d4220bc --- /dev/null +++ b/src/Bootloader/EntityBehaviorBootloader.php @@ -0,0 +1,19 @@ + EventDrivenCommandGenerator::class, + ]; + } +} diff --git a/tests/src/BaseTest.php b/tests/src/BaseTest.php index 74c034f..467e5b5 100644 --- a/tests/src/BaseTest.php +++ b/tests/src/BaseTest.php @@ -86,12 +86,16 @@ public function defineBootloaders(): array // Auth CycleBridge\AuthTokensBootloader::class, + // Validation CycleBridge\ValidationBootloader::class, // Scaffolder CycleBridge\ScaffolderBootloader::class, + // EntityBehavior + CycleBridge\EntityBehaviorBootloader::class, + // App AppBootloader::class, ]; diff --git a/tests/src/Bootloader/EntityBehaviorBootloaderTest.php b/tests/src/Bootloader/EntityBehaviorBootloaderTest.php new file mode 100644 index 0000000..19b9570 --- /dev/null +++ b/tests/src/Bootloader/EntityBehaviorBootloaderTest.php @@ -0,0 +1,17 @@ +assertContainerBound(CommandGeneratorInterface::class, EventDrivenCommandGenerator::class); + } +}