‪TYPO3CMS  10.4
Typo3QuerySettingsTest.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 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
25 class ‪Typo3QuerySettingsTest extends UnitTestCase
26 {
30  protected ‪$typo3QuerySettings;
31 
35  protected function ‪setUp(): void
36  {
37  parent::setUp();
38  $this->typo3QuerySettings = $this->getAccessibleMock(Typo3QuerySettings::class, ['dummy']);
39  }
40 
44  public function ‪booleanValueProvider()
45  {
46  return [
47  'TRUE setting' => [true],
48  'FALSE setting' => [false]
49  ];
50  }
51 
55  public function ‪arrayValueProvider()
56  {
57  return [
58  'empty array' => [[]],
59  'two elements associative' => [
60  [
61  'one' => '42',
62  21 => 12
63  ]
64  ],
65  'three elements' => [
66  [
67  1,
68  'dummy',
69  []
70  ]
71  ]
72  ];
73  }
74 
81  {
82  $this->typo3QuerySettings->setRespectStoragePage($input);
83  self::assertEquals($input, $this->typo3QuerySettings->getRespectStoragePage());
84  }
85 
90  {
91  self::assertTrue($this->typo3QuerySettings->setRespectStoragePage(true) instanceof ‪QuerySettingsInterface);
92  }
93 
101  {
102  $this->typo3QuerySettings->setStoragePageIds($input);
103  self::assertEquals($input, $this->typo3QuerySettings->getStoragePageIds());
104  }
105 
109  public function ‪setStoragePageIdsAllowsChaining()
110  {
111  self::assertTrue($this->typo3QuerySettings->setStoragePageIds([1, 2, 3]) instanceof ‪QuerySettingsInterface);
112  }
113 
121  {
122  $this->typo3QuerySettings->setRespectSysLanguage($input);
123  self::assertEquals($input, $this->typo3QuerySettings->getRespectSysLanguage());
124  }
125 
130  {
131  self::assertTrue($this->typo3QuerySettings->setRespectSysLanguage(true) instanceof ‪QuerySettingsInterface);
132  }
133 
137  public function ‪setLanguageUidAllowsChaining()
138  {
139  self::assertTrue($this->typo3QuerySettings->setLanguageUid(42) instanceof ‪QuerySettingsInterface);
140  }
141 
149  {
150  $this->typo3QuerySettings->setIgnoreEnableFields($input);
151  self::assertEquals($input, $this->typo3QuerySettings->getIgnoreEnableFields());
152  }
153 
158  {
159  self::assertTrue($this->typo3QuerySettings->setIgnoreEnableFields(true) instanceof ‪QuerySettingsInterface);
160  }
161 
169  {
170  $this->typo3QuerySettings->setEnableFieldsToBeIgnored($input);
171  self::assertEquals($input, $this->typo3QuerySettings->getEnableFieldsToBeIgnored());
172  }
173 
178  {
179  self::assertTrue($this->typo3QuerySettings->setEnableFieldsToBeIgnored(['starttime', 'endtime']) instanceof ‪QuerySettingsInterface);
180  }
181 
189  {
190  $this->typo3QuerySettings->setIncludeDeleted($input);
191  self::assertEquals($input, $this->typo3QuerySettings->getIncludeDeleted());
192  }
193 
197  public function ‪setIncludeDeletedAllowsChaining()
198  {
199  self::assertTrue($this->typo3QuerySettings->setIncludeDeleted(true) instanceof ‪QuerySettingsInterface);
200  }
201 }
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectSysLanguageSetsRespectSysLanguageCorrectly
‪setRespectSysLanguageSetsRespectSysLanguageCorrectly($input)
Definition: Typo3QuerySettingsTest.php:119
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setUp
‪setUp()
Definition: Typo3QuerySettingsTest.php:34
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIgnoreEnableFieldsAllowsChaining
‪setIgnoreEnableFieldsAllowsChaining()
Definition: Typo3QuerySettingsTest.php:156
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectStoragePageAllowsChaining
‪setRespectStoragePageAllowsChaining()
Definition: Typo3QuerySettingsTest.php:88
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\$typo3QuerySettings
‪TYPO3 CMS Extbase Persistence Generic Typo3QuerySettings $typo3QuerySettings
Definition: Typo3QuerySettingsTest.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setEnableFieldsToBeIgnoredSetsEnableFieldsToBeIgnoredCorrectly
‪setEnableFieldsToBeIgnoredSetsEnableFieldsToBeIgnoredCorrectly($input)
Definition: Typo3QuerySettingsTest.php:167
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setStoragePageIdsAllowsChaining
‪setStoragePageIdsAllowsChaining()
Definition: Typo3QuerySettingsTest.php:108
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest
Definition: Typo3QuerySettingsTest.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\arrayValueProvider
‪array arrayValueProvider()
Definition: Typo3QuerySettingsTest.php:54
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setLanguageUidAllowsChaining
‪setLanguageUidAllowsChaining()
Definition: Typo3QuerySettingsTest.php:136
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic
Definition: BackendTest.php:18
‪TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
Definition: QuerySettingsInterface.php:22
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setStoragePageIdsSetsStoragePageIdsCorrectly
‪setStoragePageIdsSetsStoragePageIdsCorrectly($input)
Definition: Typo3QuerySettingsTest.php:99
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setEnableFieldsToBeIgnoredAllowsChaining
‪setEnableFieldsToBeIgnoredAllowsChaining()
Definition: Typo3QuerySettingsTest.php:176
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIncludeDeletedAllowsChaining
‪setIncludeDeletedAllowsChaining()
Definition: Typo3QuerySettingsTest.php:196
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\booleanValueProvider
‪array booleanValueProvider()
Definition: Typo3QuerySettingsTest.php:43
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIgnoreEnableFieldsSetsIgnoreEnableFieldsCorrectly
‪setIgnoreEnableFieldsSetsIgnoreEnableFieldsCorrectly($input)
Definition: Typo3QuerySettingsTest.php:147
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectStoragePageSetsRespectStoragePageCorrectly
‪setRespectStoragePageSetsRespectStoragePageCorrectly($input)
Definition: Typo3QuerySettingsTest.php:79
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectSysLanguageAllowsChaining
‪setRespectSysLanguageAllowsChaining()
Definition: Typo3QuerySettingsTest.php:128
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIncludeDeletedSetsIncludeDeletedCorrectly
‪setIncludeDeletedSetsIncludeDeletedCorrectly($input)
Definition: Typo3QuerySettingsTest.php:187
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
Definition: Typo3QuerySettings.php:29