'documentMediaFileId' => null,
'static' => false,
]],
$this->context
);
} $this->documentGenerator->
upload($documentId,
$this->context,
$uploadFileRequest);
/** @var DocumentEntity $document */
$document =
$this->documentRepository->
search(new Criteria([$documentId]),
$this->context
)->
get($documentId);
static::
assertNotNull($document);
static::
assertNotNull($document->
getDocumentMediaFileId());
$savedContent =
$this->
getContainer()->
get(MediaService::
class)->
loadFile($document->
getDocumentMediaFileId(),
$this->context
);
static::
assertEquals($uploadFileRequest->
getContent(),
$savedContent);
} public static function uploadDataProvider(): \Generator
{ yield 'upload successfully' =>
[ false,
new Request([ 'extension' => FileTypes::PDF,