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