Skip to content

Commit

Permalink
pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main##
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Aug 20, 2024
1 parent 46d784e commit c517c8b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
//
Expand All @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit c517c8b

Please sign in to comment.