2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
namespace TTN\Tea\Tests\Unit\Domain\Model\Product;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
|
|
|
use Nimut\TestingFramework\TestCase\UnitTestCase;
|
2019-12-01 12:16:06 +01:00
|
|
|
use TTN\Tea\Domain\Model\Product\Tea;
|
2018-05-25 22:39:33 +02:00
|
|
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
2018-05-25 16:19:12 +02:00
|
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test case.
|
|
|
|
*/
|
|
|
|
class TeaTest extends UnitTestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var Tea
|
|
|
|
*/
|
|
|
|
private $subject = null;
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
protected function setUp(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
$this->subject = new Tea();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function isAbstractEntity(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertInstanceOf(AbstractEntity::class, $this->subject);
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function getTitleInitiallyReturnsEmptyString(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertSame('', $this->subject->getTitle());
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setTitleSetsTitle(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
$value = 'Club-Mate';
|
|
|
|
$this->subject->setTitle($value);
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertSame($value, $this->subject->getTitle());
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function getDescriptionInitiallyReturnsEmptyString(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertSame('', $this->subject->getDescription());
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setDescriptionSetsDescription(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
$value = 'Club-Mate';
|
|
|
|
$this->subject->setDescription($value);
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertSame($value, $this->subject->getDescription());
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
2018-05-25 22:39:33 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function getImageInitiallyReturnsNull(): void
|
2018-05-25 22:39:33 +02:00
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertNull($this->subject->getImage());
|
2018-05-25 22:39:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setImageSetsImage(): void
|
2018-05-25 22:39:33 +02:00
|
|
|
{
|
|
|
|
$model = new FileReference();
|
|
|
|
$this->subject->setImage($model);
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertSame($model, $this->subject->getImage());
|
2018-05-25 22:39:33 +02:00
|
|
|
}
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|