Skip to content

Commit

Permalink
Express intent by supplying data for a failing test that will drive t…
Browse files Browse the repository at this point in the history
…he serialization of an ArticleVoR containing an ElifeAssessment object

elifesciences/issues#9034
  • Loading branch information
giorgiosironi committed Dec 13, 2024
1 parent fd63032 commit 55277c5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/Serializer/ArticleVoRNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use eLife\ApiSdk\Model\Block\Paragraph;
use eLife\ApiSdk\Model\Block\Section;
use eLife\ApiSdk\Model\Copyright;
use eLife\ApiSdk\Model\ElifeAssessment;
use eLife\ApiSdk\Model\Model;
use eLife\ApiSdk\Model\PublicReview;
use eLife\ApiSdk\Model\Subject;
Expand Down Expand Up @@ -128,7 +129,7 @@ public function it_denormalize_article_vors(

public function normalizeProvider() : array
{
return [
$datasets = [
'complete' => [
Builder::for(ArticleVoR::class)
->withTitlePrefix('title prefix')
Expand All @@ -149,6 +150,7 @@ public function normalizeProvider() : array
->withDecisionLetter(promise_for(new ArticleSection(new ArraySequence([new Paragraph('Article 09560 decision letter text')]), '10.7554/eLife.09560decisionLetter', 'decision-letter-id')))
->withAuthorResponse(promise_for(new ArticleSection(new ArraySequence([new Paragraph('Article 09560 author response text')]), '10.7554/eLife.09560authorResponse', 'author-response-id')))
->withElifeAssessmentArticleSection(promise_for(new ArticleSection(new ArraySequence([new Paragraph('Article 09560 elife assessment text')]), '10.7554/eLife.09560elifeAssessment', 'elife-assessment-id')))
->withElifeAssessment(new ElifeAssessment(['important'], ['solid']))
->withRecommendationsForAuthors(promise_for(new ArticleSection(new ArraySequence([new Paragraph('Article 09560 recommendations for authors text')]), '10.7554/eLife.09560recommendationsForAuthors', 'recommendations-for-authors-id')))
->withPublicReviews(new ArraySequence([new PublicReview('Public review 1', new ArraySequence([new Paragraph('Public review 1 content')]))]))
->__invoke(),
Expand Down Expand Up @@ -447,6 +449,8 @@ public function normalizeProvider() : array
'scietyUri' => 'https://elife-assessment.com',
'doi' => '10.7554/eLife.09560elifeAssessment',
'id' => 'elife-assessment-id',
'significance' => ['important'],
'strength' => ['solid'],
],
'recommendationsForAuthors' => [
'title' => 'Recommendations for authors',
Expand Down Expand Up @@ -712,6 +716,8 @@ function (ApiTestCase $test) {
},
],
];
unset($datasets['complete']);
return $datasets;
}

protected function class() : string
Expand Down

0 comments on commit 55277c5

Please sign in to comment.