From c0ed29fdb6aeab0c9a34eff6c1ceaf5bdca8aa70 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 20 Aug 2024 15:57:39 +0600 Subject: [PATCH] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- .../dc/tests/OAIMetadataFormat_DCTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php index 9c15bbf0709..aac9d76e9b1 100755 --- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php +++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php @@ -35,9 +35,11 @@ use APP\section\Section; use APP\submission\Submission; use Illuminate\Support\LazyCollection; +use Mockery; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PKP\author\Repository as AuthorRepository; +use PKP\controlledVocab\Repository as ControlledVocabRepository; use PKP\core\Dispatcher; use PKP\core\Registry; use PKP\db\DAORegistry; @@ -77,6 +79,19 @@ protected function getMockedContainerKeys(): array public function testToXml() { + $controlledVocabRepoMock = Mockery::mock(ControlledVocabRepository::class) + ->makePartial() + ->shouldReceive('getBySymbolic') + ->twice() + ->withAnyArgs() + ->andReturn( + ['en' => ['article-keyword']], + ['en' => ['article-subject', 'article-subject-class']] + ) + ->getMock(); + + app()->instance(ControlledVocabRepository::class, $controlledVocabRepoMock); + // // Create test data. // @@ -100,6 +115,7 @@ public function testToXml() $publication = $this->getMockBuilder(Publication::class) ->onlyMethods([]) ->getMock(); + $publication->setData('id', 0); $publication->setData('issueId', 96); $publication->setData('pages', 15); $publication->setData('type', 'art-type', 'en'); @@ -165,6 +181,7 @@ public function testToXml() ->willReturn(Journal::PUBLISHING_MODE_OPEN); $journal->setName('journal-title', 'en'); $journal->setData('publisherInstitution', 'journal-publisher'); + $journal->setData('supportedFormLocales', []); $journal->setPrimaryLocale('en'); $journal->setPath('journal-path'); $journal->setData('onlineIssn', 'onlineIssn');