[COMPONENT][Attachment][TESTS] Fix Entity/AttachmentTest

This commit is contained in:
2022-03-07 17:08:55 +00:00
parent cc4f967186
commit 47f03d4c9f
4 changed files with 23 additions and 6 deletions

View File

@@ -87,11 +87,18 @@ class RepeatNote extends NoteHandlerPlugin
locale: \is_null($lang_id = $note->getLanguageId()) ? null : Language::getById($lang_id)->getLocale(),
// If it's a repeat, the reply_to should be to the original, conversation ought to be the same
reply_to: $note->getReplyTo(),
processed_attachments: $note->getAttachmentsWithTitle(),
processed_attachments: $processed_attachments = $note->getAttachmentsWithTitle(),
flush_and_notify: false,
rendered: $note->getRendered(),
);
// Increment attachment lives, posting already handled actor_to_attachment relations for us,
// and it obviously handled the attachment_to_note
foreach ($processed_attachments as [$a, $fname]) {
// We usually don't have to increment lives manually when storing an attachment, but we aren't re-storing it
$a->livesIncrementAndGet();
}
DB::persist(RepeatEntity::create([
'note_id' => $repeat->getId(),
'actor_id' => $actor_id,