Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 327741e

Browse files
committed
Fixed integration test
1 parent 8dc218d commit 327741e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/EventStoreIntegrationTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace HelloFresh\Tests;
44

5+
use HelloFresh\Engine\CommandBus\Handler\InMemoryLocator;
56
use HelloFresh\Engine\CommandBus\SimpleCommandBus;
67
use HelloFresh\Engine\Domain\AggregateId;
78
use HelloFresh\Engine\Domain\StreamName;
@@ -60,7 +61,8 @@ protected function tearDown()
6061
*/
6162
public function isShouldStoreEvents($eventStoreAdapter, $snapshotAdapter)
6263
{
63-
$commandBus = new SimpleCommandBus();
64+
$locator = new InMemoryLocator();
65+
$commandBus = new SimpleCommandBus($locator);
6466
$eventBus = new SimpleEventBus();
6567

6668
$eventStore = new EventStore($eventStoreAdapter);
@@ -69,7 +71,7 @@ public function isShouldStoreEvents($eventStoreAdapter, $snapshotAdapter)
6971

7072
$aggregateRepo = new AggregateRepository($eventStore, $eventBus, $snapshotter);
7173

72-
$commandBus->subscribe(AssignNameCommand::class, new AssignNameHandler($aggregateRepo));
74+
$locator->addHandler(AssignNameCommand::class, new AssignNameHandler($aggregateRepo));
7375

7476
$aggregateRoot = AggregateRoot::create(AggregateId::generate(), 'test1');
7577
$aggregateRepo->save($aggregateRoot);

0 commit comments

Comments
 (0)