TYPO3 CMS  TYPO3_6-2
Typo3QuerySettingsTest.php
Go to the documentation of this file.
1 <?php
3 
21 
26 
30  public function setUp() {
31  $this->typo3QuerySettings = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings', array('dummy'));
32  }
33 
37  public function booleanValueProvider() {
38  return array(
39  'TRUE setting' => array(TRUE),
40  'FALSE setting' => array(FALSE)
41  );
42  }
43 
47  public function arrayValueProvider() {
48  return array(
49  'empty array' => array(array()),
50  'two elements associative' => array(
51  array(
52  'one' => '42',
53  21 => 12
54  )
55  ),
56  'three elements' => array(
57  array(
58  1,
59  'dummy',
60  array()
61  )
62  )
63  );
64  }
65 
72  $this->typo3QuerySettings->setRespectStoragePage($input);
73  $this->assertEquals($input, $this->typo3QuerySettings->getRespectStoragePage());
74  }
75 
80  $this->assertTrue($this->typo3QuerySettings->setRespectStoragePage(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
81  }
82 
90  $this->typo3QuerySettings->setStoragePageIds($input);
91  $this->assertEquals($input, $this->typo3QuerySettings->getStoragePageIds());
92  }
93 
97  public function setStoragePageIdsAllowsChaining() {
98  $this->assertTrue($this->typo3QuerySettings->setStoragePageIds(array(1,2,3)) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
99  }
100 
108  $this->typo3QuerySettings->setRespectSysLanguage($input);
109  $this->assertEquals($input, $this->typo3QuerySettings->getRespectSysLanguage());
110  }
111 
116  $this->assertTrue($this->typo3QuerySettings->setRespectSysLanguage(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
117  }
118 
122  public function setLanguageUidAllowsChaining() {
123  $this->assertTrue($this->typo3QuerySettings->setLanguageUid(42) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
124  }
125 
133  $this->typo3QuerySettings->setIgnoreEnableFields($input);
134  $this->assertEquals($input, $this->typo3QuerySettings->getIgnoreEnableFields());
135  }
136 
141  $this->assertTrue($this->typo3QuerySettings->setIgnoreEnableFields(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
142  }
143 
151  $this->typo3QuerySettings->setEnableFieldsToBeIgnored($input);
152  $this->assertEquals($input, $this->typo3QuerySettings->getEnableFieldsToBeIgnored());
153  }
154 
159  $this->assertTrue($this->typo3QuerySettings->setEnableFieldsToBeIgnored(array('starttime', 'endtime')) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
160  }
161 
169  $this->typo3QuerySettings->setIncludeDeleted($input);
170  $this->assertEquals($input, $this->typo3QuerySettings->getIncludeDeleted());
171  }
172 
177  $this->assertTrue($this->typo3QuerySettings->setIncludeDeleted(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
178  }
179 
187  $this->typo3QuerySettings->setReturnRawQueryResult($input);
188  $this->assertEquals($input, $this->typo3QuerySettings->getReturnRawQueryResult());
189  }
190 
195  $this->assertTrue($this->typo3QuerySettings->setReturnRawQueryResult(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
196  }
197 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)