contentDocument Apex: How to Create a ContentDocument file in test class 1:49 PM Use ContentVersion to create the file and use ContentDocumentLink to link the file to a record.