[BUGFIX] Add missing namespace parts
[Packages/TYPO3.CMS.git] / typo3 / sysext / belog / Tests / Unit / Domain / Model / LogEntryTest.php
1 <?php
2 namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Model;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Test case
19 *
20 */
21 class LogEntryTest extends \TYPO3\Components\TestingFramework\Core\Unit\UnitTestCase
22 {
23 /**
24 * @var \TYPO3\CMS\Belog\Domain\Model\LogEntry
25 */
26 protected $subject = null;
27
28 protected function setUp()
29 {
30 $this->subject = new \TYPO3\CMS\Belog\Domain\Model\LogEntry();
31 }
32
33 /**
34 * @test
35 */
36 public function getLogDataInitiallyReturnsEmptyArray()
37 {
38 $this->assertSame([], $this->subject->getLogData());
39 }
40
41 /**
42 * @test
43 */
44 public function getLogDataForEmptyStringLogDataReturnsEmptyArray()
45 {
46 $this->subject->setLogData('');
47 $this->assertSame([], $this->subject->getLogData());
48 }
49
50 /**
51 * @test
52 */
53 public function getLogDataForGarbageStringLogDataReturnsEmptyArray()
54 {
55 $this->subject->setLogData('foo bar');
56 $this->assertSame([], $this->subject->getLogData());
57 }
58
59 /**
60 * @test
61 */
62 public function getLogDataForSerializedArrayReturnsThatArray()
63 {
64 $logData = ['foo', 'bar'];
65 $this->subject->setLogData(serialize($logData));
66 $this->assertSame($logData, $this->subject->getLogData());
67 }
68
69 /**
70 * @test
71 */
72 public function getLogDataForSerializedObjectReturnsEmptyArray()
73 {
74 $this->subject->setLogData(new \stdClass());
75 $this->assertSame([], $this->subject->getLogData());
76 }
77 }