diff --git a/composer.json b/composer.json index 78d281f..ac682b6 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,8 @@ "symfony/proxy-manager-bridge": "~2.4", "phpunit/phpunit": "^4.8", "matthiasnoback/symfony-config-test": "^2.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.1" + "matthiasnoback/symfony-dependency-injection-test": "^1.1", + "broadway/broadway-saga": "^0.2" }, "suggest": { "psr/log-implementation": "Implementation for PSR3, LoggerInterface", diff --git a/src/DependencyInjection/RegisterSagaStateRepositoryCompilerPass.php b/src/DependencyInjection/RegisterSagaStateRepositoryCompilerPass.php index e4197ac..d4f44ee 100644 --- a/src/DependencyInjection/RegisterSagaStateRepositoryCompilerPass.php +++ b/src/DependencyInjection/RegisterSagaStateRepositoryCompilerPass.php @@ -11,7 +11,7 @@ namespace Broadway\Bundle\BroadwayBundle\DependencyInjection; -use Broadway\EventStore\EventStore; +use Broadway\Saga\State\RepositoryInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; class RegisterSagaStateRepositoryCompilerPass extends CompilerPass @@ -30,7 +30,7 @@ public function process(ContainerBuilder $container) $serviceId = $container->getParameter($serviceParameter); - $this->assertDefinitionImplementsInterface($container, $serviceId, EventStore::class); + $this->assertDefinitionImplementsInterface($container, $serviceId, RepositoryInterface::class); $container->setAlias( 'broadway.saga.state.repository', diff --git a/test/DependencyInjection/CompilerPass/RegisterSagaStateRepositoryCompilerPassTest.php b/test/DependencyInjection/CompilerPass/RegisterSagaStateRepositoryCompilerPassTest.php index 5dbd4da..9f642af 100644 --- a/test/DependencyInjection/CompilerPass/RegisterSagaStateRepositoryCompilerPassTest.php +++ b/test/DependencyInjection/CompilerPass/RegisterSagaStateRepositoryCompilerPassTest.php @@ -12,6 +12,7 @@ namespace Broadway\Bundle\BroadwayBundle\DependencyInjection; use Broadway\EventStore\EventStore; +use Broadway\Saga\State\RepositoryInterface; use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; @@ -49,7 +50,7 @@ public function it_sets_the_saga_state_repository_alias() 'my_saga_state_repository' ); - $this->setDefinition('my_saga_state_repository', new Definition(EventStore::class)); + $this->setDefinition('my_saga_state_repository', new Definition(RepositoryInterface::class)); $this->compile(); @@ -77,7 +78,7 @@ public function it_throws_when_configured_saga_state_repository_has_no_definitio /** * @test * @expectedException InvalidArgumentException - * @expectedExceptionMessage Service "stdClass" must implement interface "Broadway\EventStore\EventStore". + * @expectedExceptionMessage Service "stdClass" must implement interface "Broadway\Saga\State\RepositoryInterface". */ public function it_throws_when_configured_saga_state_repository_does_not_implement_event_store_interface() {