‪TYPO3CMS  10.4
AbstractRenderableTest.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 ‪AbstractRenderableTest extends UnitTestCase
25 {
26 
31  {
32  $abstractRenderableMock = $this->getMockForAbstractClass(AbstractRenderable::class);
33 
34  $expected = ['foo' => 'bar'];
35  $abstractRenderableMock->setRenderingOption('foo', 'bar');
36 
37  self::assertSame($expected, $abstractRenderableMock->getRenderingOptions());
38  }
39 
44  {
45  $abstractRenderableMock = $this->getMockForAbstractClass(AbstractRenderable::class);
46 
47  $expected = ['foo-1' => ['bar' => 'foo-2']];
48  $abstractRenderableMock->setRenderingOption('foo-1', ['bar' => 'foo-2']);
49 
50  self::assertSame($expected, $abstractRenderableMock->getRenderingOptions());
51  }
52 
57  {
58  $abstractRenderableMock = $this->getMockForAbstractClass(AbstractRenderable::class);
59 
60  $expected = ['foo-1' => ['bar-1' => 'foo-2']];
61  $abstractRenderableMock->setRenderingOption('foo-1', ['bar-1' => 'foo-2']);
62  $abstractRenderableMock->setRenderingOption('foo-2', ['bar-2' => 'foo-3']);
63  $abstractRenderableMock->setRenderingOption('foo-2', null);
64 
65  self::assertSame($expected, $abstractRenderableMock->getRenderingOptions());
66  }
67 
72  {
73  $abstractRenderableMock = $this->getMockForAbstractClass(AbstractRenderable::class);
74 
75  $expected = [
76  'foo-1' => [
77  'bar-1' => 'foo-2'
78  ],
79  'foo-2' => [
80  'bar-2' => 'foo-3'
81  ]
82  ];
83  $abstractRenderableMock->setRenderingOption('foo-1', ['bar-1' => 'foo-2']);
84  $abstractRenderableMock->setRenderingOption('foo-2', ['bar-2' => 'foo-3', 'bar-3' => 'foo-4']);
85  $abstractRenderableMock->setRenderingOption('foo-2', ['bar-3' => null]);
86 
87  self::assertSame($expected, $abstractRenderableMock->getRenderingOptions());
88  }
89 
94  {
95  $abstractRenderableMock = $this->getMockForAbstractClass(AbstractRenderable::class);
96 
97  $expected = [
98  'foo-1' => [
99  'bar-1' => 'foo-2'
100  ],
101  'foo-2' => [
102  'bar-2' => 'foo-3',
103  'bar-3' => 'foo-4'
104  ]
105  ];
106  $abstractRenderableMock->setRenderingOption('foo-1', ['bar-1' => 'foo-2']);
107  $abstractRenderableMock->setRenderingOption('foo-2', ['bar-2' => 'foo-3']);
108  $abstractRenderableMock->setRenderingOption('foo-2', ['bar-3' => 'foo-4']);
109 
110  self::assertSame($expected, $abstractRenderableMock->getRenderingOptions());
111  }
112 }
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest\setRenderingOptionUnsetIfValueIsArrayWithSomeNullVales
‪setRenderingOptionUnsetIfValueIsArrayWithSomeNullVales()
Definition: AbstractRenderableTest.php:71
‪TYPO3\CMS\Form\Domain\Model\Renderable\AbstractRenderable
Definition: AbstractRenderable.php:42
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable
Definition: AbstractRenderableTest.php:16
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest\setRenderingOptionSetStringValueIfKeyDoesNotExists
‪setRenderingOptionSetStringValueIfKeyDoesNotExists()
Definition: AbstractRenderableTest.php:30
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest\setRenderingOptionUnsetIfValueIsNull
‪setRenderingOptionUnsetIfValueIsNull()
Definition: AbstractRenderableTest.php:56
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest
Definition: AbstractRenderableTest.php:25
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest\setRenderingOptionSetArrayValueIfKeyDoesNotExists
‪setRenderingOptionSetArrayValueIfKeyDoesNotExists()
Definition: AbstractRenderableTest.php:43
‪TYPO3\CMS\Form\Tests\Unit\Domain\Renderable\AbstractRenderableTest\setRenderingOptionAddValueIfValueIsArray
‪setRenderingOptionAddValueIfValueIsArray()
Definition: AbstractRenderableTest.php:93