Skip to content

Commit

Permalink
save 10000 events
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Mar 3, 2024
1 parent d522673 commit 6223042
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Integration/Store/StoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@ public function testSave(): void
self::assertEquals(['profileId' => 'test', 'name' => 'test'], json_decode($result1['payload'], true));
}

public function testSave10000Messages(): void
{
$messages = [];

for ($i = 1; $i <= 10000; $i++) {
$messages[] = Message::create(new ProfileCreated(ProfileId::fromString('test'), 'test'))
->withAggregateName('profile')
->withAggregateId('test')
->withPlayhead($i)
->withRecordedOn(new DateTimeImmutable('2020-01-01 00:00:00'));
}

$this->store->save(...$messages);

/** @var int $result */
$result = $this->connection->fetchFirstColumn('SELECT COUNT(*) FROM eventstore')[0];

self::assertEquals(10000, $result);
}

public function testLoad(): void
{
$message = Message::create(new ProfileCreated(ProfileId::fromString('test'), 'test'))
Expand Down

0 comments on commit 6223042

Please sign in to comment.