Skip to content

Commit

Permalink
Fix default value of Tea::internalNotes and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee committed Aug 26, 2021
1 parent b025689 commit 429f24c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Product/Tea.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Tea extends AbstractEntity
/**
* @var string
*/
private string $internalNotes;
private string $internalNotes = '';

/**
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
Expand Down
20 changes: 20 additions & 0 deletions Tests/Unit/Domain/Model/Product/TeaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,26 @@ public function setDescriptionSetsDescription(): void
self::assertSame($value, $this->subject->getDescription());
}

/**
* @test
*/
public function getInternalNotesInitiallyEmptyString(): void
{
self::assertSame('', $this->subject->getInternalNotes());
}

/**
* @test
*/
public function setInternalNotesSetsInternalNotes(): void
{
$notes = 'Yery yummy! Buy lots of this!';

$this->subject->setInternalNotes($notes);

self::assertSame($notes, $this->subject->getInternalNotes());
}

/**
* @test
*/
Expand Down

0 comments on commit 429f24c

Please sign in to comment.