'share', 'payload' => ['url' => 'https://dev.max.ru'], 'title' => 'Max Bot API', 'description' => 'Documentation for Max Bot API', 'image_url' => 'https://dev.max.ru/image.png', ]; $attachment = ShareAttachment::fromArray($data); $this->assertInstanceOf(ShareAttachment::class, $attachment); $this->assertSame(AttachmentType::Share, $attachment->type); $this->assertSame('Max Bot API', $attachment->title); $this->assertInstanceOf(ShareAttachmentRequestPayload::class, $attachment->payload); $this->assertSame('https://dev.max.ru', $attachment->payload->url); } }