2019-07-18 13:44:19 +02:00
|
|
|
<?php
|
2021-01-07 08:50:43 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test case.
|
|
|
|
*
|
|
|
|
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
|
|
*/
|
|
|
|
class DateTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \Wrm\Events\Domain\Model\Date
|
|
|
|
*/
|
|
|
|
protected $subject = null;
|
|
|
|
|
2021-01-07 09:01:58 +01:00
|
|
|
protected function setUp(): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
$this->subject = new \Wrm\Events\Domain\Model\Date();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function getStartReturnsInitialValueForDateTime()
|
|
|
|
{
|
|
|
|
self::assertEquals(
|
|
|
|
null,
|
|
|
|
$this->subject->getStart()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function setStartForDateTimeSetsStart()
|
|
|
|
{
|
|
|
|
$dateTimeFixture = new \DateTime();
|
|
|
|
$this->subject->setStart($dateTimeFixture);
|
|
|
|
|
|
|
|
self::assertAttributeEquals(
|
|
|
|
$dateTimeFixture,
|
|
|
|
'start',
|
|
|
|
$this->subject
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function getEndReturnsInitialValueForDateTime()
|
|
|
|
{
|
|
|
|
self::assertEquals(
|
|
|
|
null,
|
|
|
|
$this->subject->getEnd()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function setEndForDateTimeSetsEnd()
|
|
|
|
{
|
|
|
|
$dateTimeFixture = new \DateTime();
|
|
|
|
$this->subject->setEnd($dateTimeFixture);
|
|
|
|
|
|
|
|
self::assertAttributeEquals(
|
|
|
|
$dateTimeFixture,
|
|
|
|
'end',
|
|
|
|
$this->subject
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|