Skip to content

Commit

Permalink
fix projectionist config
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Aug 5, 2023
1 parent 535c895 commit fd63faa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ private function configureProjection(array $config, ContainerBuilder $container)
new Reference(ProjectionStore::class),
new Reference(ProjectorRepository::class),
new Reference(ProjectorResolver::class),
new Reference('event_dispatcher', ContainerInterface::NULL_ON_INVALID_REFERENCE),
new Reference(LoggerInterface::class, ContainerInterface::NULL_ON_INVALID_REFERENCE),
])
->addTag('monolog.logger', ['channel' => 'projectionist']);
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/PatchlevelEventSourcingBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AggregateRootRegistry;
use Patchlevel\EventSourcing\Metadata\Event\EventRegistry;
use Patchlevel\EventSourcing\Projection\Projectionist\RunProjectionistEventBusWrapper;
use Patchlevel\EventSourcing\Projection\Projectionist\DefaultProjectionist;
use Patchlevel\EventSourcing\Projection\Projectionist\Projectionist;
use Patchlevel\EventSourcing\Repository\DefaultRepository;
use Patchlevel\EventSourcing\Repository\DefaultRepositoryManager;
use Patchlevel\EventSourcing\Repository\RepositoryManager;
Expand Down Expand Up @@ -59,6 +61,8 @@
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Clock\ClockInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -652,6 +656,7 @@ public function testProjectionistSync(): void
);

self::assertInstanceOf(RunProjectionistEventBusWrapper::class, $container->get(EventBus::class));
self::assertInstanceOf(DefaultProjectionist::class, $container->get(Projectionist::class));
}

public function testProjectionistAsync(): void
Expand Down Expand Up @@ -761,6 +766,8 @@ private function compileContainer(ContainerBuilder $container, array $config): v
$container->set('event.bus', $this->prophesize(MessageBusInterface::class)->reveal());
$container->set('cache.default', $this->prophesize(CacheItemPoolInterface::class)->reveal());
$container->set('lock.default.factory', $this->prophesize(LockFactory::class)->reveal());
$container->set('event_dispatcher', $this->prophesize(EventDispatcherInterface::class)->reveal());
$container->set(LoggerInterface::class, $this->prophesize(LoggerInterface::class)->reveal());

$extension = new PatchlevelEventSourcingExtension();
$extension->load($config, $container);
Expand Down

0 comments on commit fd63faa

Please sign in to comment.