‪TYPO3CMS  10.4
ConstraintTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪ConstraintTest extends UnitTestCase
25 {
29  protected ‪$subject;
30 
31  protected function ‪setUp(): void
32  {
33  parent::setUp();
34  $this->subject = new ‪Constraint();
35  }
36 
41  {
42  $date = new \DateTime();
43  $this->subject->setManualDateStart($date);
44  self::assertEquals($date, $this->subject->getManualDateStart());
45  }
46 
51  {
52  $this->subject->setManualDateStart();
53  self::assertNull($this->subject->getManualDateStart());
54  }
55 
60  {
61  $date = new \DateTime();
62  $this->subject->setManualDateStop($date);
63  self::assertEquals($date, $this->subject->getManualDateStop());
64  }
65 
70  {
71  $this->subject->setManualDateStop();
72  self::assertNull($this->subject->getManualDateStop());
73  }
74 }
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest
Definition: ConstraintTest.php:25
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model
Definition: ConstraintTest.php:16
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\setManualDateStopForDateTimeSetsManualDateStop
‪setManualDateStopForDateTimeSetsManualDateStop()
Definition: ConstraintTest.php:58
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\$subject
‪TYPO3 CMS Belog Domain Model Constraint $subject
Definition: ConstraintTest.php:28
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\setUp
‪setUp()
Definition: ConstraintTest.php:30
‪TYPO3\CMS\Belog\Domain\Model\Constraint
Definition: Constraint.php:23
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\setManualDateStartForNoArgumentSetsManualDateStart
‪setManualDateStartForNoArgumentSetsManualDateStart()
Definition: ConstraintTest.php:49
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\setManualDateStopForNoArgumentSetsManualDateStop
‪setManualDateStopForNoArgumentSetsManualDateStop()
Definition: ConstraintTest.php:68
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\ConstraintTest\setManualDateStartForDateTimeSetsManualDateStart
‪setManualDateStartForDateTimeSetsManualDateStart()
Definition: ConstraintTest.php:39