32 $proxy = $this->
buildAccessibleProxy(
'TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\AbstractMenuContentObject');
33 $this->fixture =
new $proxy();
34 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
35 $GLOBALS[
'TSFE'] = $this->getMock(
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(
$GLOBALS[
'TYPO3_CONF_VARS'], 1, 1));
36 $GLOBALS[
'TSFE']->cObj = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer();
49 $this->fixture->sys_page = $this->getMock(
'TYPO3\\CMS\\Frontend\\Page\\PageRepository');
50 $this->fixture->parent_cObj = $this->getMock(
'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
58 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(NULL));
59 $result = $this->fixture->_call(
'sectionIndex',
'field');
60 $this->assertEquals(
$result, array());
68 $this->fixture->id = 10;
69 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(NULL))->with(10);
70 $result = $this->fixture->_call(
'sectionIndex',
'field');
71 $this->assertEquals(
$result, array());
80 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(array()));
81 $this->fixture->parent_cObj->expects($this->once())->method(
'exec_getQuery')->will($this->returnValue(0));
82 $this->fixture->_call(
'sectionIndex',
'field');
90 $this->fixture->mconf[
'sectionIndex.'][
'type'] =
'all';
91 $GLOBALS[
'TSFE']->sys_language_contentOL = 1;
92 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(array(
'_PAGES_OVERLAY_LANGUAGE' => 1)));
93 $this->fixture->parent_cObj->expects($this->once())->method(
'exec_getQuery')->will($this->returnValue(1));
94 $GLOBALS[
'TYPO3_DB']->expects($this->exactly(2))->method(
'sql_fetch_assoc')->will($this->onConsecutiveCalls($this->returnValue(array(
'uid' => 0,
'header' =>
'NOT_OVERLAID')), $this->returnValue(FALSE)));
95 $this->fixture->sys_page->expects($this->once())->method(
'getRecordOverlay')->will($this->returnValue(array(
'uid' => 0,
'header' =>
'OVERLAID')));
96 $result = $this->fixture->_call(
'sectionIndex',
'field');
97 $this->assertEquals(
$result[0][
'title'],
'OVERLAID');
105 'unfiltered fields' => array(
113 'with unset section index' => array(
121 'with unset header' => array(
129 'with header layout 100' => array(
134 'header_layout' => 100
148 $this->fixture->mconf[
'sectionIndex.'][
'type'] =
'header';
149 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(array()));
150 $this->fixture->parent_cObj->expects($this->once())->method(
'exec_getQuery')->will($this->returnValue(1));
151 $GLOBALS[
'TYPO3_DB']->expects($this->exactly(2))->method(
'sql_fetch_assoc')->will($this->onConsecutiveCalls($this->returnValue($dataRow), $this->returnValue(FALSE)));
152 $result = $this->fixture->_call(
'sectionIndex',
'field');
153 $this->assertCount($expectedAmount,
$result);
161 'no configuration' => array(
165 'with useColPos 2' => array(
166 array(
'useColPos' => 2),
169 'with useColPos -1' => array(
170 array(
'useColPos' => -1),
173 'with stdWrap useColPos' => array(
175 'useColPos.' => array(
192 $this->fixture->sys_page->expects($this->once())->method(
'getPage')->will($this->returnValue(array()));
193 $this->fixture->mconf[
'sectionIndex.'] = $configuration;
194 $queryConfiguration = array(
196 'orderBy' =>
'field',
197 'languageField' =>
'sys_language_uid',
198 'where' => $whereClausePrefix
200 $this->fixture->parent_cObj->expects($this->once())->method(
'exec_getQuery')->with(
'tt_content', $queryConfiguration)->will($this->returnValue(1));
201 $this->fixture->_call(
'sectionIndex',
'field', 12);
212 'none excluded' => array (
217 'one excluded' => array (
222 'three excluded' => array (
227 'empty excludeList' => array (
232 'empty menu' => array (
250 foreach ($menuItems as $page) {
251 $menu[] = array(
'uid' => $page);
255 $this->fixture->parent_cObj = $this->getMock(
'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array());
257 $this->fixture->sys_page->expects($this->once())->method(
'getMenu')->will($this->returnValue($menu));
258 $this->fixture->menuArr = array(
259 0 => array(
'uid' => 1)
261 $this->fixture->conf[
'excludeUidList'] = $excludeUidList;
263 $this->assertEquals($expectedResult, $this->fixture->isItemState(
'IFSUB', 0));
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
buildAccessibleProxy($className)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]