diff --git a/tests/Integration/Store/StoreTest.php b/tests/Integration/Store/StoreTest.php index 5fbc6541b..dc8b6e481 100644 --- a/tests/Integration/Store/StoreTest.php +++ b/tests/Integration/Store/StoreTest.php @@ -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'))