‪TYPO3CMS  9.5
Typo3QuerySettingsTest.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 
17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
18 
22 class ‪Typo3QuerySettingsTest extends UnitTestCase
23 {
27  protected ‪$typo3QuerySettings;
28 
32  protected function ‪setUp()
33  {
34  $this->typo3QuerySettings = $this->getAccessibleMock(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class, ['dummy']);
35  }
36 
40  public function ‪booleanValueProvider()
41  {
42  return [
43  'TRUE setting' => [true],
44  'FALSE setting' => [false]
45  ];
46  }
47 
51  public function ‪arrayValueProvider()
52  {
53  return [
54  'empty array' => [[]],
55  'two elements associative' => [
56  [
57  'one' => '42',
58  21 => 12
59  ]
60  ],
61  'three elements' => [
62  [
63  1,
64  'dummy',
65  []
66  ]
67  ]
68  ];
69  }
70 
77  {
78  $this->typo3QuerySettings->setRespectStoragePage($input);
79  $this->assertEquals($input, $this->typo3QuerySettings->getRespectStoragePage());
80  }
81 
86  {
87  $this->assertTrue($this->typo3QuerySettings->setRespectStoragePage(true) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
88  }
89 
97  {
98  $this->typo3QuerySettings->setStoragePageIds($input);
99  $this->assertEquals($input, $this->typo3QuerySettings->getStoragePageIds());
100  }
101 
105  public function ‪setStoragePageIdsAllowsChaining()
106  {
107  $this->assertTrue($this->typo3QuerySettings->setStoragePageIds([1, 2, 3]) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
108  }
109 
117  {
118  $this->typo3QuerySettings->setRespectSysLanguage($input);
119  $this->assertEquals($input, $this->typo3QuerySettings->getRespectSysLanguage());
120  }
121 
126  {
127  $this->assertTrue($this->typo3QuerySettings->setRespectSysLanguage(true) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
128  }
129 
133  public function ‪setLanguageUidAllowsChaining()
134  {
135  $this->assertTrue($this->typo3QuerySettings->setLanguageUid(42) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
136  }
137 
145  {
146  $this->typo3QuerySettings->setIgnoreEnableFields($input);
147  $this->assertEquals($input, $this->typo3QuerySettings->getIgnoreEnableFields());
148  }
149 
154  {
155  $this->assertTrue($this->typo3QuerySettings->setIgnoreEnableFields(true) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
156  }
157 
165  {
166  $this->typo3QuerySettings->setEnableFieldsToBeIgnored($input);
167  $this->assertEquals($input, $this->typo3QuerySettings->getEnableFieldsToBeIgnored());
168  }
169 
174  {
175  $this->assertTrue($this->typo3QuerySettings->setEnableFieldsToBeIgnored(['starttime', 'endtime']) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
176  }
177 
185  {
186  $this->typo3QuerySettings->setIncludeDeleted($input);
187  $this->assertEquals($input, $this->typo3QuerySettings->getIncludeDeleted());
188  }
189 
193  public function ‪setIncludeDeletedAllowsChaining()
194  {
195  $this->assertTrue($this->typo3QuerySettings->setIncludeDeleted(true) instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\QuerySettingsInterface);
196  }
197 }
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectSysLanguageSetsRespectSysLanguageCorrectly
‪setRespectSysLanguageSetsRespectSysLanguageCorrectly($input)
Definition: Typo3QuerySettingsTest.php:115
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setUp
‪setUp()
Definition: Typo3QuerySettingsTest.php:31
‪TYPO3
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIgnoreEnableFieldsAllowsChaining
‪setIgnoreEnableFieldsAllowsChaining()
Definition: Typo3QuerySettingsTest.php:152
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectStoragePageAllowsChaining
‪setRespectStoragePageAllowsChaining()
Definition: Typo3QuerySettingsTest.php:84
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\$typo3QuerySettings
‪TYPO3 CMS Extbase Persistence Generic Typo3QuerySettings $typo3QuerySettings
Definition: Typo3QuerySettingsTest.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setEnableFieldsToBeIgnoredSetsEnableFieldsToBeIgnoredCorrectly
‪setEnableFieldsToBeIgnoredSetsEnableFieldsToBeIgnoredCorrectly($input)
Definition: Typo3QuerySettingsTest.php:163
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setStoragePageIdsAllowsChaining
‪setStoragePageIdsAllowsChaining()
Definition: Typo3QuerySettingsTest.php:104
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest
Definition: Typo3QuerySettingsTest.php:23
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\arrayValueProvider
‪array arrayValueProvider()
Definition: Typo3QuerySettingsTest.php:50
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setLanguageUidAllowsChaining
‪setLanguageUidAllowsChaining()
Definition: Typo3QuerySettingsTest.php:132
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic
Definition: BackendTest.php:3
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setStoragePageIdsSetsStoragePageIdsCorrectly
‪setStoragePageIdsSetsStoragePageIdsCorrectly($input)
Definition: Typo3QuerySettingsTest.php:95
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setEnableFieldsToBeIgnoredAllowsChaining
‪setEnableFieldsToBeIgnoredAllowsChaining()
Definition: Typo3QuerySettingsTest.php:172
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIncludeDeletedAllowsChaining
‪setIncludeDeletedAllowsChaining()
Definition: Typo3QuerySettingsTest.php:192
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\booleanValueProvider
‪array booleanValueProvider()
Definition: Typo3QuerySettingsTest.php:39
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIgnoreEnableFieldsSetsIgnoreEnableFieldsCorrectly
‪setIgnoreEnableFieldsSetsIgnoreEnableFieldsCorrectly($input)
Definition: Typo3QuerySettingsTest.php:143
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectStoragePageSetsRespectStoragePageCorrectly
‪setRespectStoragePageSetsRespectStoragePageCorrectly($input)
Definition: Typo3QuerySettingsTest.php:75
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setRespectSysLanguageAllowsChaining
‪setRespectSysLanguageAllowsChaining()
Definition: Typo3QuerySettingsTest.php:124
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Typo3QuerySettingsTest\setIncludeDeletedSetsIncludeDeletedCorrectly
‪setIncludeDeletedSetsIncludeDeletedCorrectly($input)
Definition: Typo3QuerySettingsTest.php:183