36 'Single year' => array(
37 'seconds' => 60 * 60 * 24 * 365,
38 'expectedLabel' =>
'1 year' 40 'Plural years' => array(
41 'seconds' => 60 * 60 * 24 * 365 * 2,
42 'expectedLabel' =>
'2 yrs' 44 'Single negative year' => array(
45 'seconds' => 60 * 60 * 24 * 365 * -1,
46 'expectedLabel' =>
'-1 year' 48 'Plural negative years' => array(
49 'seconds' => 60 * 60 * 24 * 365 * 2 * -1,
50 'expectedLabel' =>
'-2 yrs' 52 'Single day' => array(
53 'seconds' => 60 * 60 * 24,
54 'expectedLabel' =>
'1 day' 56 'Plural days' => array(
57 'seconds' => 60 * 60 * 24 * 2,
58 'expectedLabel' =>
'2 days' 60 'Single negative day' => array(
61 'seconds' => 60 * 60 * 24 * -1,
62 'expectedLabel' =>
'-1 day' 64 'Plural negative days' => array(
65 'seconds' => 60 * 60 * 24 * 2 * -1,
66 'expectedLabel' =>
'-2 days' 68 'Single hour' => array(
70 'expectedLabel' =>
'1 hour' 72 'Plural hours' => array(
73 'seconds' => 60 * 60 * 2,
74 'expectedLabel' =>
'2 hrs' 76 'Single negative hour' => array(
77 'seconds' => 60 * 60 * -1,
78 'expectedLabel' =>
'-1 hour' 80 'Plural negative hours' => array(
81 'seconds' => 60 * 60 * 2 * -1,
82 'expectedLabel' =>
'-2 hrs' 84 'Single minute' => array(
86 'expectedLabel' =>
'1 min' 88 'Plural minutes' => array(
90 'expectedLabel' =>
'2 min' 92 'Single negative minute' => array(
94 'expectedLabel' =>
'-1 min' 96 'Plural negative minutes' => array(
97 'seconds' => 60 * 2 * -1,
98 'expectedLabel' =>
'-2 min' 100 'Zero seconds' => array(
102 'expectedLabel' =>
'0 min' 124 'tt_content' => array(
134 $this->assertEquals(
'0', BackendUtility::getProcessedValue(
'tt_content',
'header',
'0'));
142 'tt_content' => array(
144 'multimedia' => array(
152 $this->assertSame(
'1, 2', BackendUtility::getProcessedValue(
'tt_content',
'multimedia',
'1,2'));
158 public function getProcessedValueForGroupWithOneAllowedTable() {
162 $subject = __NAMESPACE__ .
'\\' . $className;
164 'namespace ' . __NAMESPACE__ .
';' .
165 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
166 ' static public function getRecordWSOL() {' .
167 ' static $called = 0;' .
169 ' if ($called === 1) {' .
170 ' return array(\'title\' => \'Page 1\');' .
172 ' if ($called === 2) {' .
173 ' return array(\'title\' => \'Page 2\');' .
176 ' static public function getRecordTitle() {' .
177 ' static $called = 0;' .
179 ' if ($called === 1) {' .
180 ' return \'Page 1\';' .
182 ' if ($called === 2) {' .
183 ' return \'Page 2\';' .
190 'tt_content' => array(
195 'allowed' =>
'pages',
196 'internal_type' =>
'db',
207 $this->assertSame(
'Page 1, Page 2', $subject::getProcessedValue(
'tt_content',
'pages',
'1,2'));
213 public function getProcessedValueForGroupWithMultipleAllowedTables() {
217 $subject = __NAMESPACE__ .
'\\' . $className;
219 'namespace ' . __NAMESPACE__ .
';' .
220 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
221 ' static public function getRecordWSOL() {' .
222 ' static $called = 0;' .
224 ' if ($called === 1) {' .
225 ' return array(\'title\' => \'Page 1\');' .
227 ' if ($called === 2) {' .
228 ' return array(\'header\' => \'Configuration 2\');' .
231 ' static public function getRecordTitle() {' .
232 ' static $called = 0;' .
234 ' if ($called === 1) {' .
235 ' return \'Page 1\';' .
237 ' if ($called === 2) {' .
238 ' return \'Configuration 2\';' .
245 'index_config' => array(
247 'indexcfgs' => array(
250 'internal_type' =>
'db',
251 'allowed' =>
'index_config,pages',
259 $this->assertSame(
'Page 1, Configuration 2', $subject::getProcessedValue(
'index_config',
'indexcfgs',
'pages_1,index_config_2'));
265 public function getProcessedValueForSelectWithMMRelation() {
266 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(),
'', FALSE);
267 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'fullQuoteStr')
268 ->will($this->returnCallback(
269 function($quoteStr, $table) {
270 return "'" . $quoteStr .
"'";
273 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'exec_SELECTquery')->will($this->returnValue(0));
274 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'sql_free_result');
275 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'sql_fetch_assoc')
276 ->will($this->returnCallback(
298 'title' =>
'Category 1',
303 'title' =>
'Category 2',
314 $subject = __NAMESPACE__ .
'\\' . $className;
316 'namespace ' . __NAMESPACE__ .
';' .
317 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
318 ' static public function getRecordTitle($table, $row) {' .
319 ' return $row["title"];' .
327 'categories' => array(
330 'foreign_table' =>
'sys_category',
331 'MM' =>
'sys_category_record_mm',
332 'MM_match_fields' => array(
333 'fieldname' =>
'categories',
334 'tablesnames' =>
'pages',
336 'MM_opposite_field' =>
'items',
341 'sys_category' => array(
346 'internal_type' =>
'db',
348 'MM' =>
'sys_category_record_mm',
349 'MM_oppositeUsage' => array(),
356 $this->assertSame(
'Category 1; Category 2', $subject::getProcessedValue(
'pages',
'categories',
'2', 0, FALSE, FALSE, 1));
371 'table' =>
'test_table',
373 'presetFields' => array(),
375 'expectedFields' =>
'uid' 377 'label set' => array(
378 'table' =>
'test_table',
380 'presetFields' => array(),
386 'expectedFields' =>
'uid,label' 388 'label_alt set' => array(
389 'table' =>
'test_table',
391 'presetFields' => array(),
394 'label_alt' =>
'label,label2' 397 'expectedFields' =>
'uid,label,label2' 399 'versioningWS set' => array(
400 'table' =>
'test_table',
402 'presetFields' => array(),
405 'versioningWS' =>
'2' 408 'expectedFields' =>
'uid,t3ver_id,t3ver_state,t3ver_wsid,t3ver_count' 410 'selicon_field set' => array(
411 'table' =>
'test_table',
413 'presetFields' => array(),
416 'selicon_field' =>
'field' 419 'expectedFields' =>
'uid,field' 421 'typeicon_column set' => array(
422 'table' =>
'test_table',
424 'presetFields' => array(),
427 'typeicon_column' =>
'field' 430 'expectedFields' =>
'uid,field' 432 'enablecolumns set' => array(
433 'table' =>
'test_table',
435 'presetFields' => array(),
438 'enablecolumns' => array(
439 'disabled' =>
'hidden',
440 'starttime' =>
'start',
442 'fe_group' =>
'groups' 446 'expectedFields' =>
'uid,hidden,start,stop,groups' 448 'label set to uid' => array(
449 'table' =>
'test_table',
451 'presetFields' => array(),
457 'expectedFields' =>
'uid' 469 $this->assertEquals($selectFields, $expectedFields);
484 'table' =>
'tt_content',
485 'col' =>
'menu_type',
489 'menu_type' => array(
492 array(
'Item 1',
'0'),
493 array(
'Item 2',
'1'),
500 'expectedLabel' =>
'Item 2' 502 'item set twice' => array(
503 'table' =>
'tt_content',
504 'col' =>
'menu_type',
508 'menu_type' => array(
511 array(
'Item 1',
'0'),
512 array(
'Item 2a',
'1'),
513 array(
'Item 2b',
'1'),
520 'expectedLabel' =>
'Item 2a' 522 'item not found' => array(
523 'table' =>
'tt_content',
524 'col' =>
'menu_type',
528 'menu_type' => array(
531 array(
'Item 1',
'0'),
532 array(
'Item 2',
'1'),
539 'expectedLabel' => NULL
551 $this->assertEquals($label, $expectedLabel);
565 'no field found' => array(
567 'table' =>
'tt_content',
568 'col' =>
'menu_type',
572 'menu_type' => array(
575 array(
'Item 1',
'0'),
576 array(
'Item 2',
'1'),
583 'expectedLabel' =>
'' 585 'no tsconfig set' => array(
587 'table' =>
'tt_content',
588 'col' =>
'menu_type',
592 'menu_type' => array(
595 array(
'Item 1',
'0'),
596 array(
'Item 2',
'1'),
603 'expectedLabel' =>
'Item 2' 612 public function getLabelFromItemListMergedReturnsCorrectFields($pageId, $table, $column =
'', $key =
'', array
$tca, $expectedLabel =
'') {
616 $subject = __NAMESPACE__ .
'\\' . $className;
618 'namespace ' . __NAMESPACE__ .
';' .
619 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
620 ' static public function getPagesTSconfig() {' .
628 $this->assertEquals($expectedLabel, $subject::getLabelFromItemListMerged($pageId, $table, $column, $key));
654 'someColumn' => array(
657 '0' => array(
'aFooLabel',
'foo'),
658 '1' => array(
'aBarLabel',
'bar')
665 $GLOBALS[
'LANG'] = $this->getMock(
'TYPO3\\CMS\\Lang\\LanguageService', array(), array(),
'', FALSE);
666 $GLOBALS[
'LANG']->expects($this->any())->method(
'sL')
667 ->will($this->returnCallback(
675 $this->assertEquals(
'aFooLabel, aBarLabel', $label);
686 'someColumn' => array(
690 '0' => array(
'aFooLabel',
'foo'),
691 '1' => array(
'aBarLabel',
'bar')
698 $GLOBALS[
'LANG'] = $this->getMock(
'TYPO3\\CMS\\Lang\\LanguageService', array(), array(),
'', FALSE);
699 $GLOBALS[
'LANG']->charSet =
'utf-8';
700 $GLOBALS[
'LANG']->csConvObj = $this->getMock(
'TYPO3\\CMS\\Core\\Charset\\CharsetConverter');
701 $GLOBALS[
'LANG']->expects($this->any())->method(
'sL')
702 ->will($this->returnCallback(
707 $GLOBALS[
'LANG']->csConvObj->expects($this->any())->method(
'crop')
708 ->will($this->returnCallback(
709 function($charset, $string, $len, $crop =
'') {
715 $label = BackendUtility::getProcessedValue($table, $col,
'foo,invalidKey,bar');
716 $this->assertEquals(
'aFooLabel, aBarLabel', $label);
727 'someColumn' => array(
731 '0' => array(
'aFooLabel',
'foo')
738 $GLOBALS[
'LANG'] = $this->getMock(
'TYPO3\\CMS\\Lang\\LanguageService', array(), array(),
'', FALSE);
739 $GLOBALS[
'LANG']->charSet =
'utf-8';
740 $GLOBALS[
'LANG']->csConvObj = $this->getMock(
'TYPO3\\CMS\\Core\\Charset\\CharsetConverter');
741 $GLOBALS[
'LANG']->expects($this->any())->method(
'sL')
742 ->will($this->returnCallback(
747 $GLOBALS[
'LANG']->csConvObj->expects($this->any())->method(
'crop')
748 ->will($this->returnCallback(
749 function($charset, $string, $len, $crop =
'') {
755 $label = BackendUtility::getProcessedValue($table, $col,
'invalidKey');
756 $this->assertEquals(
'invalidKey', $label);
768 'getExcludeFields does not return fields not configured as exclude field' => array(
792 'getExcludeFields returns fields from root level tables if root level restriction should be ignored' => array(
799 'ignoreRootLevelRestriction' => TRUE,
817 'getExcludeFields does not return fields from root level tables' => array(
834 'getExcludeFields does not return fields from admin only level tables' => array(
861 public function getExcludeFieldsReturnsCorrectFieldList($tca, $expected) {
864 $subject = __NAMESPACE__ .
'\\' . $className;
866 'namespace ' . __NAMESPACE__ .
';' .
867 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
868 ' static public function getRegisteredFlexForms() {' .
877 $GLOBALS[
'LANG'] = $this->getMock(
'TYPO3\\CMS\\Lang\\LanguageService', array(), array(),
'', FALSE);
878 $GLOBALS[
'LANG']->expects($this->any())->method(
'sL')
879 ->will($this->returnCallback(
885 $this->assertSame($expected, $subject::getExcludeFields());
891 public function getExcludeFieldsReturnsCorrectListWithFlexFormFields() {
907 'label' =>
'abarfoo',
917 'tx_foobar' => array(
949 $expectedResult = array(
959 'abarfoo dummy: The Title:',
960 'tx_foo:abarfoo;dummy;sGeneral;xmlTitle' 981 $GLOBALS[
'LANG'] = $this->getMock(
'TYPO3\\CMS\\Lang\\LanguageService', array(), array(),
'', FALSE);
982 $GLOBALS[
'LANG']->expects($this->any())->method(
'sL')
983 ->will($this->returnCallback(
991 $subject = __NAMESPACE__ .
'\\' . $className;
993 'namespace ' . __NAMESPACE__ .
';' .
994 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
995 ' static public function getRegisteredFlexForms($table) {' .
996 ' static $called = 0;' .
998 ' if ($called === 1) {' .
1001 ' if ($called === 2) {' .
1002 ' if ($table !== \'tx_foo\') {' .
1003 ' throw new Exception(\'Expected tx_foo as argument on call 2\', 1399638572);' .
1005 ' $parsedFlexForm = array(' .
1006 ' \'abarfoo\' => array(' .
1007 ' \'dummy\' => array(' .
1008 ' \'title\' => \'dummy\',' .
1009 ' \'ds\' => array(' .
1010 ' \'sheets\' => array(' .
1011 ' \'sGeneral\' => array(' .
1012 ' \'ROOT\' => array(' .
1013 ' \'type\' => \'array\',' .
1014 ' \'el\' => array(' .
1015 ' \'xmlTitle\' => array(' .
1016 ' \'TCEforms\' => array(' .
1017 ' \'exclude\' => 1,' .
1018 ' \'label\' => \'The Title:\',' .
1019 ' \'config\' => array(' .
1020 ' \'type\' => \'input\',' .
1021 ' \'size\' => 48,' .
1033 ' return $parsedFlexForm;' .
1035 ' if ($called === 3) {' .
1036 ' return array();' .
1042 $this->assertSame($expectedResult, $subject::getExcludeFields());
1055 unset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_befunc.php'][
'viewOnClickClass']);
1057 $alternativeUrl =
'https://typo3.org/about/typo3-the-cms/the-history-of-typo3/#section';
1058 $onclickCode =
'var previewWin = window.open(\'' . $alternativeUrl .
'\',\
'newTYPO3frontendWindow\');';
1059 $this->assertStringMatchesFormat(
1074 'replaceMarkersInWhereClause replaces record field marker with quoted string' => array(
1075 ' AND dummytable.title=\'###REC_FIELD_dummyfield###\'',
1077 '_THIS_ROW' => array(
1078 'dummyfield' =>
'Hello World' 1081 ' AND dummytable.title=\'Hello World\'' 1083 'replaceMarkersInWhereClause replaces record field marker with fullquoted string' => array(
1084 ' AND dummytable.title=###REC_FIELD_dummyfield###',
1086 '_THIS_ROW' => array(
1087 'dummyfield' =>
'Hello World' 1090 ' AND dummytable.title=\'Hello World\'' 1092 'replaceMarkersInWhereClause replaces multiple record field markers' => array(
1093 ' AND dummytable.title=\'###REC_FIELD_dummyfield###\' AND dummytable.pid=###REC_FIELD_pid###',
1095 '_THIS_ROW' => array(
1096 'dummyfield' =>
'Hello World',
1100 ' AND dummytable.title=\'Hello World\' AND dummytable.pid=\'42\'' 1102 'replaceMarkersInWhereClause replaces current pid with integer' => array(
1103 ' AND dummytable.uid=###CURRENT_PID###',
1105 '_CURRENT_PID' => 42
1107 ' AND dummytable.uid=42' 1109 'replaceMarkersInWhereClause replaces current pid with string' => array(
1110 ' AND dummytable.uid=###CURRENT_PID###',
1112 '_CURRENT_PID' =>
'42string' 1114 ' AND dummytable.uid=42' 1116 'replaceMarkersInWhereClause replaces current record uid with integer' => array(
1117 ' AND dummytable.uid=###THIS_UID###',
1121 ' AND dummytable.uid=42' 1123 'replaceMarkersInWhereClause replaces current record uid with string' => array(
1124 ' AND dummytable.uid=###THIS_UID###',
1126 '_THIS_UID' =>
'42string' 1128 ' AND dummytable.uid=42' 1130 'replaceMarkersInWhereClause replaces current record cid with integer' => array(
1131 ' AND dummytable.uid=###THIS_CID###',
1135 ' AND dummytable.uid=42' 1137 'replaceMarkersInWhereClause replaces current record cid with string' => array(
1138 ' AND dummytable.uid=###THIS_CID###',
1140 '_THIS_CID' =>
'42string' 1142 ' AND dummytable.uid=42' 1144 'replaceMarkersInWhereClause replaces storage pid with integer' => array(
1145 ' AND dummytable.uid=###STORAGE_PID###',
1147 '_STORAGE_PID' => 42
1149 ' AND dummytable.uid=42' 1151 'replaceMarkersInWhereClause replaces storage pid with string' => array(
1152 ' AND dummytable.uid=###STORAGE_PID###',
1154 '_STORAGE_PID' =>
'42string' 1156 ' AND dummytable.uid=42' 1158 'replaceMarkersInWhereClause replaces siteroot uid with integer' => array(
1159 ' AND dummytable.uid=###SITEROOT###',
1163 ' AND dummytable.uid=42' 1165 'replaceMarkersInWhereClause replaces siteroot uid with string' => array(
1166 ' AND dummytable.uid=###SITEROOT###',
1168 '_SITEROOT' =>
'42string' 1170 ' AND dummytable.uid=42' 1172 'replaceMarkersInWhereClause replaces page tsconfig id with integer' => array(
1173 ' AND dummytable.uid=###PAGE_TSCONFIG_ID###',
1175 'dummyfield' => array(
1176 'PAGE_TSCONFIG_ID' => 42
1179 ' AND dummytable.uid=42' 1181 'replaceMarkersInWhereClause replaces page tsconfig id with string' => array(
1182 ' AND dummytable.uid=###PAGE_TSCONFIG_ID###',
1184 'dummyfield' => array(
1185 'PAGE_TSCONFIG_ID' =>
'42string' 1188 ' AND dummytable.uid=42' 1190 'replaceMarkersInWhereClause replaces page tsconfig string' => array(
1191 ' AND dummytable.title=\'###PAGE_TSCONFIG_STR###\'',
1193 'dummyfield' => array(
1194 'PAGE_TSCONFIG_STR' =>
'42' 1197 ' AND dummytable.title=\'42\'' 1199 'replaceMarkersInWhereClause replaces all markers' => array(
1200 ' AND dummytable.title=\'###REC_FIELD_dummyfield###\'' .
1201 ' AND dummytable.uid=###REC_FIELD_uid###' .
1202 ' AND dummytable.pid=###CURRENT_PID###' .
1203 ' AND dummytable.l18n_parent=###THIS_UID###' .
1204 ' AND dummytable.cid=###THIS_CID###' .
1205 ' AND dummytable.storage_pid=###STORAGE_PID###' .
1206 ' AND dummytable.siteroot=###SITEROOT###' .
1207 ' AND dummytable.config_uid=###PAGE_TSCONFIG_ID###' .
1208 ' AND dummytable.idlist IN (###PAGE_TSCONFIG_IDLIST###)' .
1209 ' AND dummytable.string=\'###PAGE_TSCONFIG_STR###\'',
1211 '_THIS_ROW' => array(
1212 'dummyfield' =>
'Hello World',
1215 '_CURRENT_PID' =>
'1',
1218 '_STORAGE_PID' => 4,
1220 'dummyfield' => array(
1221 'PAGE_TSCONFIG_ID' => 6,
1222 'PAGE_TSCONFIG_IDLIST' =>
'1,2,3',
1223 'PAGE_TSCONFIG_STR' =>
'string' 1226 ' AND dummytable.title=\'Hello World\' AND dummytable.uid=\'42\' AND dummytable.pid=1' .
1227 ' AND dummytable.l18n_parent=2 AND dummytable.cid=3 AND dummytable.storage_pid=4' .
1228 ' AND dummytable.siteroot=5 AND dummytable.config_uid=6 AND dummytable.idlist IN (1,2,3)' .
1229 ' AND dummytable.string=\'string\'',
1240 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(),
'', FALSE);
1241 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'quoteStr')
1242 ->will($this->returnCallback(
1243 function($quoteStr, $table) {
1247 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'fullQuoteStr')
1248 ->will($this->returnCallback(
1249 function($quoteStr, $table) {
1250 return "'" . $quoteStr .
"'";
1253 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'cleanIntList')
1254 ->will($this->returnCallback(
1255 function($intList) {
1266 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(),
'', FALSE);
1267 $GLOBALS[
'TYPO3_DB']->expects($this->once())->method(
'cleanIntList')->with(
'1,a,2,b,3,c');
1268 $where =
' AND dummytable.uid IN (###PAGE_TSCONFIG_IDLIST###)';
1270 'dummyfield' => array(
1271 'PAGE_TSCONFIG_IDLIST' =>
'1,a,2,b,3,c' 1280 public function getModTSconfigIgnoresValuesFromUserTsConfigIfNoSet() {
1281 $completeConfiguration = array(
1283 'properties' => array(
1284 'permissions.' => array(
1286 'default.' => array(
'readAction' =>
'1'),
1287 '1.' => array(
'writeAction' =>
'1'),
1288 '0.' => array(
'readAction' =>
'0'),
1294 $GLOBALS[
'BE_USER'] = $this->getMock(
'TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication', array(), array(),
'', FALSE);
1295 $GLOBALS[
'BE_USER']->expects($this->at(0))->method(
'getTSConfig')->will($this->returnValue($completeConfiguration));
1296 $GLOBALS[
'BE_USER']->expects($this->at(1))->method(
'getTSConfig')->will($this->returnValue(array(
'value' => NULL,
'properties' => NULL)));
1299 $className = $this->
getUniqueId(
'BackendUtility');
1300 $subject = __NAMESPACE__ .
'\\' . $className;
1302 'namespace ' . __NAMESPACE__ .
';' .
1303 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility {' .
1304 ' static public function getPagesTSconfig() {' .
1305 ' return array();' .
1310 $this->assertSame($completeConfiguration, $subject::getModTSconfig(42,
'notrelevant'));
1319 'same table: mergeIfNotBlank' => array(
1324 'field3' =>
'trans',
1329 'transOrigPointerTable' =>
'',
1330 'transOrigPointerField' =>
'origUid' 1333 'field2' => array(
'l10n_mode' =>
'mergeIfNotBlank'),
1334 'field3' => array(
'l10n_mode' =>
'mergeIfNotBlank')
1340 'field2' =>
'basic',
1346 'field3' =>
'trans',
1349 'other table: mergeIfNotBlank' => array(
1354 'field3' =>
'trans',
1359 'transOrigPointerTable' =>
'bar',
1360 'transOrigPointerField' =>
'origUid' 1365 'field2' => array(
'l10n_mode' =>
'mergeIfNotBlank'),
1366 'field3' => array(
'l10n_mode' =>
'mergeIfNotBlank')
1372 'field2' =>
'basic',
1377 'field2' =>
'basic',
1378 'field3' =>
'trans',
1381 'same table: exclude' => array(
1386 'field3' =>
'trans',
1391 'transOrigPointerTable' =>
'',
1392 'transOrigPointerField' =>
'origUid' 1395 'field2' => array(
'l10n_mode' =>
'exclude'),
1396 'field3' => array(
'l10n_mode' =>
'exclude')
1402 'field2' =>
'basic',
1407 'field2' =>
'basic',
1411 'other table: exclude' => array(
1416 'field3' =>
'trans',
1421 'transOrigPointerTable' =>
'bar',
1422 'transOrigPointerField' =>
'origUid' 1427 'field2' => array(
'l10n_mode' =>
'exclude'),
1428 'field3' => array(
'l10n_mode' =>
'exclude')
1434 'field2' =>
'basic',
1439 'field2' =>
'basic',
1450 public function replaceL10nModeFieldsReplacesFields($table, $row, $tca, $originalRow, $expected) {
1452 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
1453 $GLOBALS[
'TYPO3_DB']->expects($this->any())->method(
'exec_SELECTgetSingleRow')->will($this->returnValue($originalRow));
1456 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Backend\\Utility\\BackendUtility', array(
'dummy'));
1457 $this->assertSame($expected, $subject->_call(
'replaceL10nModeFields', $table, $row));
getProcessedValueForZeroStringIsZero()
viewOnClickReturnsOnClickCodeWithAlternativeUrl()
static getFuncCheck($mainParams, $elementName, $currentValue, $script='', $addParams='', $tagParams='')
calcAgeReturnsExpectedValues($seconds, $expectedLabel)
replaceMarkersInWhereClauseReturnsValidWhereClause($whereClause, $tsConfig, $expected)
getProcessedValueReturnsPlainValueIfItemIsNotFound()
replaceL10nModeFieldsReplacesFieldsDataProvider()
getLabelFromItemListMergedReturnsCorrectFieldsDataProvider()
static replaceMarkersInWhereClause($whereClause, $table, $field='', $tsConfig=array())
getLabelsFromItemsListReturnsValueIfItemIsFound()
static calcAge($seconds, $labels=' min|hrs|days|yrs|min|hour|day|year')
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
getProcessedValueForGroup()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
getCommonSelectFieldsReturnsCorrectFieldsDataProvider()
getCommonSelectFieldsReturnsCorrectFields($table, $prefix='', array $presetFields, array $tca, $expectedFields='')
static getCommonSelectFields($table, $prefix='', $fields=array())
getLabelFromItemlistReturnsCorrectFields($table, $col='', $key='', array $tca, $expectedLabel='')
getProcessedValueReturnsLabelsForExistingValuesSolely()
getExcludeFieldsDataProvider()
static getLabelsFromItemsList($table, $column, $key)
replaceMarkersInWhereClauseDataProvider()
replaceMarkersInWhereClauseCleansIdList()
getLabelFromItemlistReturnsCorrectFieldsDataProvider()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getFuncCheckReturnsInputTagWithValueAttribute()
static getLabelFromItemlist($table, $col, $key)