'reply_keyboard', 'buttons' => [ [['type' => 'message', 'text' => 'Hello']], [['type' => 'user_contact', 'text' => 'My Contact']] ] ]; $factory = new ModelFactory(); $attachment = $factory->createAttachment($data); $this->assertInstanceOf(ReplyKeyboardAttachment::class, $attachment); $this->assertCount(2, $attachment->buttons); $this->assertInstanceOf(SendContactButton::class, $attachment->buttons[1][0]); $this->assertSame('My Contact', $attachment->buttons[1][0]->text); } }