[ [ 'update_type' => UpdateType::MessageCreated->value, 'timestamp' => 1678886400000, 'message' => [ 'timestamp' => 1678886400000, 'body' => ['mid' => 'mid.123', 'seq' => 1, 'text' => 'Hello'], 'recipient' => ['chat_type' => 'dialog', 'user_id' => 123], ], 'user_locale' => 'ru-RU', ], ], 'marker' => 1, ]; $factory = new ModelFactory(); $updateList = $factory->createUpdateList($data); $this->assertInstanceOf(UpdateList::class, $updateList); $this->assertCount(1, $updateList->updates); $this->assertInstanceOf(MessageCreatedUpdate::class, $updateList->updates[0]); $this->assertSame(1, $updateList->marker); } #[Test] public function directCallToFromArrayThrowsException(): void { $this->expectException(LogicException::class); $this->expectExceptionMessageMatches('/Cannot create .* directly from an array/'); UpdateList::fromArray(['updates' => [], 'marker' => 1]); } }