2021-04-28 16:18:59 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "googletest.h"
|
|
|
|
|
|
|
|
|
|
#include "sqlitedatabasemock.h"
|
|
|
|
|
|
2021-09-16 17:19:56 +02:00
|
|
|
#include <projectstorage/filestatus.h>
|
|
|
|
|
#include <projectstorage/projectstorageinterface.h>
|
2021-05-06 12:26:39 +02:00
|
|
|
#include <projectstorage/sourcepathcache.h>
|
2021-04-28 16:18:59 +02:00
|
|
|
|
2021-09-16 17:19:56 +02:00
|
|
|
class ProjectStorageMock : public QmlDesigner::ProjectStorageInterface
|
2021-04-28 16:18:59 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2021-10-20 17:34:46 +02:00
|
|
|
MOCK_METHOD(void, synchronize, (QmlDesigner::Storage::SynchronizationPackage package), (override));
|
2021-04-28 16:18:59 +02:00
|
|
|
|
2021-10-11 11:15:47 +02:00
|
|
|
MOCK_METHOD(QmlDesigner::ModuleId, moduleId, (Utils::SmallStringView), (override));
|
|
|
|
|
|
2021-09-16 17:19:56 +02:00
|
|
|
MOCK_METHOD(QmlDesigner::FileStatus,
|
|
|
|
|
fetchFileStatus,
|
|
|
|
|
(QmlDesigner::SourceId sourceId),
|
|
|
|
|
(const, override));
|
2021-04-28 16:18:59 +02:00
|
|
|
|
2021-10-19 14:42:28 +02:00
|
|
|
MOCK_METHOD(QmlDesigner::Storage::ProjectDatas,
|
|
|
|
|
fetchProjectDatas,
|
2021-09-16 17:19:56 +02:00
|
|
|
(QmlDesigner::SourceId sourceId),
|
|
|
|
|
(const, override));
|
2021-04-28 16:18:59 +02:00
|
|
|
|
2021-09-16 17:19:56 +02:00
|
|
|
MOCK_METHOD(QmlDesigner::SourceContextId,
|
|
|
|
|
fetchSourceContextId,
|
|
|
|
|
(Utils::SmallStringView SourceContextPath),
|
|
|
|
|
());
|
|
|
|
|
MOCK_METHOD(QmlDesigner::SourceId,
|
|
|
|
|
fetchSourceId,
|
|
|
|
|
(QmlDesigner::SourceContextId SourceContextId, Utils::SmallStringView sourceName),
|
|
|
|
|
());
|
|
|
|
|
MOCK_METHOD(QmlDesigner::SourceContextId,
|
|
|
|
|
fetchSourceContextIdUnguarded,
|
|
|
|
|
(Utils::SmallStringView SourceContextPath),
|
|
|
|
|
());
|
|
|
|
|
MOCK_METHOD(QmlDesigner::SourceId,
|
|
|
|
|
fetchSourceIdUnguarded,
|
|
|
|
|
(QmlDesigner::SourceContextId SourceContextId, Utils::SmallStringView sourceName),
|
|
|
|
|
());
|
|
|
|
|
MOCK_METHOD(Utils::PathString,
|
|
|
|
|
fetchSourceContextPath,
|
|
|
|
|
(QmlDesigner::SourceContextId sourceContextId));
|
|
|
|
|
MOCK_METHOD(QmlDesigner::Cache::SourceNameAndSourceContextId,
|
|
|
|
|
fetchSourceNameAndSourceContextId,
|
|
|
|
|
(QmlDesigner::SourceId sourceId));
|
|
|
|
|
MOCK_METHOD(std::vector<QmlDesigner::Cache::SourceContext>, fetchAllSourceContexts, (), ());
|
|
|
|
|
MOCK_METHOD(std::vector<QmlDesigner::Cache::Source>, fetchAllSources, (), ());
|
2021-04-28 16:18:59 +02:00
|
|
|
};
|
|
|
|
|
|