diff --git a/src/Bootloader/PrototypeBootloader.php b/src/Bootloader/PrototypeBootloader.php new file mode 100644 index 0000000..734ad93 --- /dev/null +++ b/src/Bootloader/PrototypeBootloader.php @@ -0,0 +1,23 @@ +bindProperty('workflow', WorkflowClientInterface::class); + $prototype->bindProperty('workflowManager', WorkflowManagerInterface::class); + } +} diff --git a/tests/src/Bootloader/PrototypeBootloaderTest.php b/tests/src/Bootloader/PrototypeBootloaderTest.php new file mode 100644 index 0000000..33fef54 --- /dev/null +++ b/tests/src/Bootloader/PrototypeBootloaderTest.php @@ -0,0 +1,30 @@ +getContainer()->get(PrototypeRegistry::class); + + $this->assertInstanceOf( + $expected, + $this->getContainer()->get($registry->resolveProperty($property)->type->name()) + ); + } + + public function propertiesDataProvider(): \Traversable + { + yield [WorkflowClientInterface::class, 'workflow']; + yield [WorkflowManagerInterface::class, 'workflowManager']; + } +} diff --git a/tests/src/TestCase.php b/tests/src/TestCase.php index e88cca9..fc57ced 100644 --- a/tests/src/TestCase.php +++ b/tests/src/TestCase.php @@ -16,6 +16,7 @@ public function defineBootloaders(): array \Spiral\Boot\Bootloader\ConfigurationBootloader::class, \Spiral\Bootloader\Attributes\AttributesBootloader::class, \Spiral\TemporalBridge\Bootloader\TemporalBridgeBootloader::class, + \Spiral\TemporalBridge\Bootloader\PrototypeBootloader::class, // ... ]; }