Skip to content

Commit

Permalink
Avoid coupling to other properties in a focused test
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaKind committed Jan 10, 2025
1 parent 86ae597 commit 06db036
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/Model/ElifeAssessmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,31 @@
use eLife\ApiSdk\Model\ElifeAssessment;
use eLife\ApiSdk\Model\Block\Paragraph;
use PHPUnit\Framework\TestCase;
use test\eLife\ApiSdk\Builder;

final class ElifeAssessmentTest extends TestCase
{
private $title = 'eLife Assessment';
private $articleSection;
private $builder;

/**
* @before
*/
public function set_up()
{
$this->articleSection = new ArticleSection(new ArraySequence([new Paragraph('eLife assessment')]));
$this->builder = Builder::for(ElifeAssessment::class);
}

/**
* @test
*/
public function it_has_a_title()
{
$assessment = new ElifeAssessment($this->title, $this->articleSection, null, null);
$assessment = $this->builder
->withTitle($this->title)
->__invoke();

$this->assertSame($this->title, $assessment->getTitle());
}
Expand Down

0 comments on commit 06db036

Please sign in to comment.