diff --git a/src/Model/ElifeAssessment.php b/src/Model/ElifeAssessment.php index 4f6d4bbc..98e7eb95 100644 --- a/src/Model/ElifeAssessment.php +++ b/src/Model/ElifeAssessment.php @@ -14,7 +14,7 @@ final class ElifeAssessment implements Model */ public function __construct( string $title, - ArticleSection $articleSection = null, + ArticleSection $articleSection, array $significance = null, array $strength = null ) { @@ -29,10 +29,7 @@ public function getTitle(): string return $this->title; } - /** - * @return ArticleSection|null - */ - public function getArticleSection() + public function getArticleSection(): ArticleSection { return $this->articleSection; } diff --git a/test/Builder.php b/test/Builder.php index 4a109a9f..c3294e14 100644 --- a/test/Builder.php +++ b/test/Builder.php @@ -279,7 +279,7 @@ private function defaultTestData() ElifeAssessment::class => function () { return [ 'title' => 'eLife Assessment', - 'articleSection' => null, + 'articleSection' => new ArticleSection(new ArraySequence([new Paragraph('Article 09560 elife assessment text')]), '10.7554/eLife.09560elifeAssessment', 'elife-assessment-id'), 'significance' => ['Landmark', 'Important'], 'strength' => ['Solid', 'Adequate'], ]; diff --git a/test/Model/ArticleVoRTest.php b/test/Model/ArticleVoRTest.php index 07b79183..68a49ac4 100644 --- a/test/Model/ArticleVoRTest.php +++ b/test/Model/ArticleVoRTest.php @@ -312,7 +312,7 @@ public function it_may_be_vor_prc() public function it_may_have_an_elife_assessment() { $with = $this->builder - ->withElifeAssessment($elifeAssessment = new ElifeAssessment('elife assessment', null, ['solid'], null)) + ->withElifeAssessment($elifeAssessment = Builder::dummy(ElifeAssessment::class)) ->__invoke(); $withOut = $this->builder ->withElifeAssessment(null) diff --git a/test/Model/ElifeAssessmentTest.php b/test/Model/ElifeAssessmentTest.php index 7e282971..906c96a1 100644 --- a/test/Model/ElifeAssessmentTest.php +++ b/test/Model/ElifeAssessmentTest.php @@ -26,7 +26,7 @@ public function set_up() */ public function it_has_a_title() { - $assessment = new ElifeAssessment($this->title, null, null, null); + $assessment = new ElifeAssessment($this->title, $this->articleSection, null, null); $this->assertSame($this->title, $assessment->getTitle()); } @@ -46,8 +46,8 @@ public function it_has_an_article_section() */ public function it_may_have_significance_terms() { - $with = new ElifeAssessment($this->title, null, ['important'], ['solid']); - $withOut = new ElifeAssessment($this->title, null, null, ['solid']); + $with = new ElifeAssessment($this->title, $this->articleSection, ['important'], ['solid']); + $withOut = new ElifeAssessment($this->title, $this->articleSection, null, ['solid']); $this->assertSame(['important'], $with->getSignificance()); $this->assertNull($withOut->getSignificance()); @@ -58,8 +58,8 @@ public function it_may_have_significance_terms() */ public function it_may_have_strength_terms() { - $with = new ElifeAssessment($this->title, null, ['important'], ['solid']); - $withOut = new ElifeAssessment($this->title, null, ['important'], null); + $with = new ElifeAssessment($this->title, $this->articleSection, ['important'], ['solid']); + $withOut = new ElifeAssessment($this->title, $this->articleSection, ['important'], null); $this->assertSame(['solid'], $with->getStrength()); $this->assertNull($withOut->getStrength());