2019-07-24 14:56:21 +03:00
|
|
|
#ifndef TESTHELPER_H
|
|
|
|
#define TESTHELPER_H
|
|
|
|
|
2022-11-16 22:55:53 +03:00
|
|
|
#include "gui/accountstate.h"
|
2021-07-23 18:41:02 +03:00
|
|
|
#include "gui/folder.h"
|
2019-07-24 14:56:21 +03:00
|
|
|
#include "creds/httpcredentials.h"
|
|
|
|
|
2021-07-23 18:41:02 +03:00
|
|
|
class HttpCredentialsTest : public OCC::HttpCredentials
|
|
|
|
{
|
2019-07-24 14:56:21 +03:00
|
|
|
public:
|
|
|
|
HttpCredentialsTest(const QString& user, const QString& password)
|
|
|
|
: HttpCredentials(user, password)
|
|
|
|
{}
|
|
|
|
|
2021-08-25 17:08:36 +03:00
|
|
|
void askFromUser() override {
|
2019-07-24 14:56:21 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-07-23 18:41:02 +03:00
|
|
|
OCC::FolderDefinition folderDefinition(const QString &path);
|
2019-07-24 14:56:21 +03:00
|
|
|
|
2022-11-16 22:55:53 +03:00
|
|
|
class FakeAccountState : public OCC::AccountState
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FakeAccountState(OCC::AccountPtr account)
|
|
|
|
: OCC::AccountState()
|
|
|
|
{
|
|
|
|
_account = account;
|
|
|
|
_state = Connected;
|
|
|
|
}
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void checkConnectivity() override {};
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void setState(OCC::AccountState::State state) override { Q_UNUSED(state) };
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-18 18:15:10 +03:00
|
|
|
const QByteArray jsonValueToOccReply(const QJsonValue &jsonValue);
|
|
|
|
|
2019-07-24 14:56:21 +03:00
|
|
|
#endif // TESTHELPER_H
|