‪TYPO3CMS  11.5
LogEntryTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪LogEntryTest extends UnitTestCase
27 {
29 
30  protected function ‪setUp(): void
31  {
32  parent::setUp();
33  $this->subject = new ‪LogEntry();
34  }
35 
40  {
41  self::assertSame([], $this->subject->getLogData());
42  }
43 
48  {
49  $this->subject->setLogData('');
50  self::assertSame([], $this->subject->getLogData());
51  }
52 
57  {
58  $this->subject->setLogData('foo bar');
59  self::assertSame([], $this->subject->getLogData());
60  }
61 
66  {
67  $logData = ['foo', 'bar'];
68  $this->subject->setLogData(serialize($logData));
69  self::assertSame($logData, $this->subject->getLogData());
70  }
71 
76  {
77  $this->subject->setLogData(serialize(new \stdClass()));
78  self::assertSame([], $this->subject->getLogData());
79  }
80 }
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\getLogDataForSerializedArrayReturnsThatArray
‪getLogDataForSerializedArrayReturnsThatArray()
Definition: LogEntryTest.php:65
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest
Definition: LogEntryTest.php:27
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\getLogDataForSerializedObjectReturnsEmptyArray
‪getLogDataForSerializedObjectReturnsEmptyArray()
Definition: LogEntryTest.php:75
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\getLogDataForEmptyStringLogDataReturnsEmptyArray
‪getLogDataForEmptyStringLogDataReturnsEmptyArray()
Definition: LogEntryTest.php:47
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\getLogDataInitiallyReturnsEmptyArray
‪getLogDataInitiallyReturnsEmptyArray()
Definition: LogEntryTest.php:39
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model
Definition: ConstraintTest.php:18
‪TYPO3\CMS\Belog\Domain\Model\LogEntry
Definition: LogEntry.php:28
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\$subject
‪LogEntry $subject
Definition: LogEntryTest.php:28
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\setUp
‪setUp()
Definition: LogEntryTest.php:30
‪TYPO3\CMS\Belog\Tests\Unit\Domain\Model\LogEntryTest\getLogDataForGarbageStringLogDataReturnsEmptyArray
‪getLogDataForGarbageStringLogDataReturnsEmptyArray()
Definition: LogEntryTest.php:56