Skip to content

Commit

Permalink
Merge pull request #34 from mantiz/fix-saga-state-repository-compiler…
Browse files Browse the repository at this point in the history
…-pass

fix saga state repository compiler pass
  • Loading branch information
wjzijderveld authored Aug 19, 2017
2 parents 62de4d0 + dc30b03 commit ebed7a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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()
{
Expand Down

0 comments on commit ebed7a3

Please sign in to comment.