From f4816dcbfffa0fa15cc604ea9931abd9ad9a593c Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 27 Sep 2024 19:10:37 +0600 Subject: [PATCH] pkp/pkp-lib#9899 added backup/restore for dao and container keys --- .../CompileCounterSubmissionDailyMetricsTest.php | 15 +++++++++++++++ ...nterSubmissionInstitutionDailyMetricsTest.php | 15 +++++++++++++++ .../jobs/statistics/CompileSeriesMetricsTest.php | 11 +++++++++++ .../CompileSubmissionGeoDailyMetricsTest.php | 12 ++++++++++++ .../CompileUniqueInvestigationsTest.php | 12 ++++++++++++ .../statistics/CompileUniqueRequestsTest.php | 12 ++++++++++++ .../DeleteUsageStatsTemporaryRecordsTest.php | 16 ++++++++++++++++ .../statistics/ProcessUsageStatsLogFileTest.php | 16 ++++++++++++++++ 8 files changed, 109 insertions(+) diff --git a/tests/jobs/statistics/CompileCounterSubmissionDailyMetricsTest.php b/tests/jobs/statistics/CompileCounterSubmissionDailyMetricsTest.php index bbf4649dfa2..a7d4d8d1010 100644 --- a/tests/jobs/statistics/CompileCounterSubmissionDailyMetricsTest.php +++ b/tests/jobs/statistics/CompileCounterSubmissionDailyMetricsTest.php @@ -31,6 +31,21 @@ class CompileCounterSubmissionDailyMetricsTest extends PKPTestCase O:56:"APP\jobs\statistics\CompileCounterSubmissionDailyMetrics":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryTotalsDAO', + 'TemporaryItemInvestigationsDAO', + 'TemporaryItemRequestsDAO', + 'TemporaryTitleInvestigationsDAO', + 'TemporaryTitleRequestsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/CompileCounterSubmissionInstitutionDailyMetricsTest.php b/tests/jobs/statistics/CompileCounterSubmissionInstitutionDailyMetricsTest.php index e8a79dab46e..1d726de9913 100644 --- a/tests/jobs/statistics/CompileCounterSubmissionInstitutionDailyMetricsTest.php +++ b/tests/jobs/statistics/CompileCounterSubmissionInstitutionDailyMetricsTest.php @@ -31,6 +31,21 @@ class CompileCounterSubmissionInstitutionDailyMetricsTest extends PKPTestCase O:67:"APP\jobs\statistics\CompileCounterSubmissionInstitutionDailyMetrics":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryTotalsDAO', + 'TemporaryItemInvestigationsDAO', + 'TemporaryItemRequestsDAO', + 'TemporaryTitleInvestigationsDAO', + 'TemporaryTitleRequestsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/CompileSeriesMetricsTest.php b/tests/jobs/statistics/CompileSeriesMetricsTest.php index ecc53d02d65..771b5546e8a 100644 --- a/tests/jobs/statistics/CompileSeriesMetricsTest.php +++ b/tests/jobs/statistics/CompileSeriesMetricsTest.php @@ -31,6 +31,17 @@ class CompileSeriesMetricsTest extends PKPTestCase O:40:"APP\jobs\statistics\CompileSeriesMetrics":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryTotalsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/CompileSubmissionGeoDailyMetricsTest.php b/tests/jobs/statistics/CompileSubmissionGeoDailyMetricsTest.php index 577a340c4a9..4a7aed3ab68 100644 --- a/tests/jobs/statistics/CompileSubmissionGeoDailyMetricsTest.php +++ b/tests/jobs/statistics/CompileSubmissionGeoDailyMetricsTest.php @@ -31,6 +31,18 @@ class CompileSubmissionGeoDailyMetricsTest extends PKPTestCase O:52:"APP\jobs\statistics\CompileSubmissionGeoDailyMetrics":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryTotalsDAO', + 'TemporaryTitleInvestigationsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/CompileUniqueInvestigationsTest.php b/tests/jobs/statistics/CompileUniqueInvestigationsTest.php index 90456a100d2..40b01c942e1 100644 --- a/tests/jobs/statistics/CompileUniqueInvestigationsTest.php +++ b/tests/jobs/statistics/CompileUniqueInvestigationsTest.php @@ -31,6 +31,18 @@ class CompileUniqueInvestigationsTest extends PKPTestCase O:47:"APP\jobs\statistics\CompileUniqueInvestigations":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryItemInvestigationsDAO', + 'TemporaryTitleInvestigationsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/CompileUniqueRequestsTest.php b/tests/jobs/statistics/CompileUniqueRequestsTest.php index 6446717d85b..3331972d601 100644 --- a/tests/jobs/statistics/CompileUniqueRequestsTest.php +++ b/tests/jobs/statistics/CompileUniqueRequestsTest.php @@ -31,6 +31,18 @@ class CompileUniqueRequestsTest extends PKPTestCase O:41:"APP\jobs\statistics\CompileUniqueRequests":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryItemRequestsDAO', + 'TemporaryTitleRequestsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/DeleteUsageStatsTemporaryRecordsTest.php b/tests/jobs/statistics/DeleteUsageStatsTemporaryRecordsTest.php index 4ea86b1edff..0a0881661ce 100644 --- a/tests/jobs/statistics/DeleteUsageStatsTemporaryRecordsTest.php +++ b/tests/jobs/statistics/DeleteUsageStatsTemporaryRecordsTest.php @@ -31,6 +31,22 @@ class DeleteUsageStatsTemporaryRecordsTest extends PKPTestCase O:52:"APP\jobs\statistics\DeleteUsageStatsTemporaryRecords":3:{s:9:"\0*\0loadId";s:25:"usage_events_20240130.log";s:10:"connection";s:8:"database";s:5:"queue";s:5:"queue";} END; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryTotalsDAO', + 'TemporaryItemInvestigationsDAO', + 'TemporaryItemRequestsDAO', + 'TemporaryTitleInvestigationsDAO', + 'TemporaryTitleRequestsDAO', + 'TemporaryInstitutionsDAO', + ]; + } + /** * Test job is a proper instance */ diff --git a/tests/jobs/statistics/ProcessUsageStatsLogFileTest.php b/tests/jobs/statistics/ProcessUsageStatsLogFileTest.php index a07f9a828e4..29934eb82d9 100644 --- a/tests/jobs/statistics/ProcessUsageStatsLogFileTest.php +++ b/tests/jobs/statistics/ProcessUsageStatsLogFileTest.php @@ -39,6 +39,22 @@ class ProcessUsageStatsLogFileTest extends PKPTestCase */ protected $dummyFileContent = '{"time":"2023-08-07 17:27:11","ip":"228dc4e5b6424e9dad52f21261cb2ab5f4651d9cb426d6fdb3d71d5ab8e2ae83","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko\/20100101 Firefox\/115.0","canonicalUrl":"http:\/\/ojs-stable-3_4_0.test\/index.php\/publicknowledge\/index","assocType":512,"contextId":1,"submissionId":null,"representationId":null,"submissionFileId":null,"fileType":null,"country":null,"region":null,"city":null,"institutionIds":[],"version":"3.4.0.0","issueId":null,"issueGalleyId":null}'; + /** + * @see PKPTestCase::getMockedDAOs() + */ + protected function getMockedDAOs(): array + { + return [ + ...parent::getMockedDAOs(), + 'TemporaryInstitutionsDAO', + 'TemporaryTotalsDAO', + 'TemporaryItemInvestigationsDAO', + 'TemporaryItemRequestsDAO', + 'TemporaryTitleInvestigationsDAO', + 'TemporaryTitleRequestsDAO', + ]; + } + /** * Test job is a proper instance */