Skip to content

Commit

Permalink
Reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed May 13, 2022
1 parent 7e640d4 commit 85b973e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions test/testutils/syncenginetestutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,8 @@ FakeFolder::FakeFolder(const FileInfo &fileTemplate, OCC::Vfs::Mode vfsMode)
toDisk(rootDir, fileTemplate);

_fakeAm = new FakeAM(fileTemplate);
_account = OCC::Account::create();
_account->setUrl(QUrl(QStringLiteral("http://admin:admin@localhost/owncloud")));
_account = OCC::TestUtils::createDummyAccount();
_account->setCredentials(new FakeCredentials { _fakeAm });
_account->setDavDisplayName(QStringLiteral("fakename"));
_account->setServerVersion(QStringLiteral("10.0.0"), QStringLiteral("FakeServer"));
_account->setCapabilities(OCC::TestUtils::testCapabilities());

_journalDb.reset(new OCC::SyncJournalDb(localPath() + QStringLiteral(".sync_test.db")));
// TODO: davUrl
Expand Down
3 changes: 2 additions & 1 deletion test/testutils/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ namespace TestUtils {
HttpCredentialsTest *cred = new HttpCredentialsTest("testuser", "secret");
acc->setCredentials(cred);
acc->setUrl(QUrl(QStringLiteral("http://localhost/owncloud")));
acc->setDavDisplayName(QStringLiteral("fakename") + acc->uuid().toString());
acc->setDavDisplayName(QStringLiteral("fakename") + acc->uuid().toString(QUuid::WithoutBraces));
acc->setServerVersion(QStringLiteral("10.0.0"), QStringLiteral("FakeServer"));
acc->setCapabilities(OCC::TestUtils::testCapabilities());
OCC::AccountManager::instance()->addAccount(acc);
return acc;
}
Expand Down

0 comments on commit 85b973e

Please sign in to comment.