Update test code.

This commit is contained in:
James Cole
2021-03-20 07:21:13 +01:00
parent 836f0ecf3f
commit bc5aa4b4cd
41 changed files with 255 additions and 945 deletions

View File

@@ -179,7 +179,15 @@ class AttachmentRepository implements AttachmentRepositoryInterface
$attachment->filename = $data['filename'];
}
}
// update model (move attachment)
// should be validated already:
if (array_key_exists('attachable_type', $data) && array_key_exists('attachable_id', $data)) {
$attachment->attachable_id = (int)$data['attachable_id'];
$attachment->attachable_type = sprintf('FireflyIII\\Models\\%s', $data['attachable_type']);
}
$attachment->save();
$attachment->refresh();
if (array_key_exists('notes', $data)) {
$this->updateNote($attachment, (string)$data['notes']);
}