Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Nov 11, 2024
1 parent 1fad74e commit 6bcb1b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Classes/Processing/BibEntryConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class BibEntryConfig
[
'field' => 'firstName',
'conditionField' => 'creatorType',
'conditionValue' => 'editor',
'conditionValue' => 'translator',
'conditionRelation' => 'eq'
],
[
'field' => 'lastName',
'conditionField' => 'creatorType',
'conditionValue' => 'editor',
'conditionValue' => 'translator',
'conditionRelation' => 'eq'
]
],
Expand Down Expand Up @@ -132,7 +132,7 @@ public static function getAuthorHeader(): array

public static function getEditorHeader(): array
{
return [ self::postfix(self::EDITOR, '(Hg.)') ];
return [ self::postfix(self::EDITOR, ' (Hg.)') ];
}

public static function getBody(): array
Expand All @@ -146,7 +146,7 @@ public static function getArticleFooter(): array
self::postfix(self::PUBLICATION_TITLE, ' '),
self::postfix(self::VOLUME, ' '),
self::circumfix(self::DATE, '(', '), '),
self::circumfix(self::VOLUME, 'Nr. ', ', '),
self::circumfix(self::ISSUE, 'Nr. ', ', '),
self::PAGES
];
}
Expand Down
17 changes: 9 additions & 8 deletions Tests/Unit/Processing/BibEntryProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class BibEntryProcessorTest extends UnitTestCase

private string $authorFirstName = 'ex_author_first';
private string $authorLastName = 'ex_author_last';
private string $editorFirstName = 'ex_edior_first';
private string $editorFirstName = 'ex_editor_first';
private string $editorLastName = 'ex_editor_last';
private string $title = 'ex_title';
private string $bookTitle = 'ex_book_title';
Expand Down Expand Up @@ -148,8 +148,8 @@ public function headerIsProcessedCorrectly(): void
$article = $this->subject->process($this->exampleArticleArray, new Collection(), new Collection());
$bookWithoutAuthor = $this->subject->process($this->exampleBookWithoutAuthorArray, new Collection(), new Collection());

$expected = Str::of($this->authorLastName . ', ' . $this->authorFirstName);
$expectedWithoutAuthor = Str::of($this->editorLastName . ', ' . $this->editorFirstName);
$expected = Str::of($this->authorFirstName . ' ' . $this->authorLastName);
$expectedWithoutAuthor = Str::of($this->editorFirstName . ' ' . $this->editorLastName . ' (Hg.)');

self::assertEquals($book['tx_lisztcommon_header'], $expected);
self::assertEquals($bookSection['tx_lisztcommon_header'], $expected);
Expand Down Expand Up @@ -188,10 +188,10 @@ public function bookFooterIsProcessedCorrectly(): void
public function bookSectionFooterIsProcessedCorrectly(): void
{
$bookSection = $this->subject->process($this->exampleBookSectionArray, new Collection(), new Collection());
$expected = Str::of($this->editorFirstName . ' ' . $this->editorLastName . ': ' .
$this->bookTitle . ', ' . $this->place . ' ' . $this->date . ' ' . $this->pages);
$expected = Str::of('In ' . $this->bookTitle . ', ' . 'hg. von ' . $this->editorFirstName . ' ' . $this->editorLastName .
', ' . $this->place . ' ' . $this->date . ', ' . $this->pages);

self::assertEquals($bookSection['tx_lisztcommon_body'], $this->title);
self::assertEquals($bookSection['tx_lisztcommon_footer'], $expected);
}

/**
Expand All @@ -200,9 +200,10 @@ public function bookSectionFooterIsProcessedCorrectly(): void
public function articleFooterIsProcessedCorrectly(): void
{
$article = $this->subject->process($this->exampleArticleArray, new Collection(), new Collection());
$expected = Str::of($this->bookTitle . ', ' . $this->volume . '(' . $this->issue . ')' . $this->pages);
$expected = Str::of($this->bookTitle . ' ' . $this->volume . ' (' . $this->date . '), Nr. ' . $this->issue . ', ' . $this->pages);
var_dump($article['tx_lisztcommon_footer']);

self::assertEquals($article['tx_lisztcommon_body'], $this->title);
self::assertEquals($article['tx_lisztcommon_footer'], $expected);
}


Expand Down

0 comments on commit 6bcb1b8

Please sign in to comment.