nextcloud-desktop/test/testhelper.cpp
Claudio Cambra 7ba6969e65
Moved all server mocking code for share model test to independent ShareTestUtils file
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2022-10-31 18:06:10 +01:00

28 lines
608 B
C++

#include "testhelper.h"
#include <QJsonObject>
#include <QJsonDocument>
OCC::FolderDefinition folderDefinition(const QString &path)
{
OCC::FolderDefinition d;
d.localPath = path;
d.targetPath = path;
d.alias = path;
return d;
}
const QByteArray jsonValueToOccReply(const QJsonValue &jsonValue)
{
QJsonObject root;
QJsonObject ocs;
QJsonObject meta;
meta.insert("statuscode", 200);
ocs.insert(QStringLiteral("data"), jsonValue);
ocs.insert(QStringLiteral("meta"), meta);
root.insert(QStringLiteral("ocs"), ocs);
return QJsonDocument(root).toJson();
}