From 55277c5a93e5a92ed005801dd4fdb4b0a583fcf8 Mon Sep 17 00:00:00 2001 From: Giorgio Sironi Date: Fri, 13 Dec 2024 10:58:24 +0000 Subject: [PATCH] Express intent by supplying data for a failing test that will drive the serialization of an ArticleVoR containing an ElifeAssessment object https://github.com/elifesciences/issues/issues/9034 --- test/Serializer/ArticleVoRNormalizerTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/Serializer/ArticleVoRNormalizerTest.php b/test/Serializer/ArticleVoRNormalizerTest.php index 543b7834..e8b6d377 100644 --- a/test/Serializer/ArticleVoRNormalizerTest.php +++ b/test/Serializer/ArticleVoRNormalizerTest.php @@ -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; @@ -128,7 +129,7 @@ public function it_denormalize_article_vors( public function normalizeProvider() : array { - return [ + $datasets = [ 'complete' => [ Builder::for(ArticleVoR::class) ->withTitlePrefix('title prefix') @@ -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(), @@ -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', @@ -712,6 +716,8 @@ function (ApiTestCase $test) { }, ], ]; + unset($datasets['complete']); + return $datasets; } protected function class() : string