‪TYPO3CMS  10.4
BackendUtilityTest.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 
18 use Doctrine\DBAL\Driver\Statement;
19 use Prophecy\Argument;
20 use Prophecy\Prophecy\ObjectProphecy;
21 use Psr\EventDispatcher\EventDispatcherInterface;
43 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
44 
48 class ‪BackendUtilityTest extends UnitTestCase
49 {
53  protected ‪$resetSingletonInstances = true;
54 
56  // Tests concerning calcAge
58 
63  public function ‪calcAgeDataProvider()
64  {
65  return [
66  'Single year' => [
67  'seconds' => 60 * 60 * 24 * 365,
68  'expectedLabel' => '1 year'
69  ],
70  'Plural years' => [
71  'seconds' => 60 * 60 * 24 * 365 * 2,
72  'expectedLabel' => '2 yrs'
73  ],
74  'Single negative year' => [
75  'seconds' => 60 * 60 * 24 * 365 * -1,
76  'expectedLabel' => '-1 year'
77  ],
78  'Plural negative years' => [
79  'seconds' => 60 * 60 * 24 * 365 * 2 * -1,
80  'expectedLabel' => '-2 yrs'
81  ],
82  'Single day' => [
83  'seconds' => 60 * 60 * 24,
84  'expectedLabel' => '1 day'
85  ],
86  'Plural days' => [
87  'seconds' => 60 * 60 * 24 * 2,
88  'expectedLabel' => '2 days'
89  ],
90  'Single negative day' => [
91  'seconds' => 60 * 60 * 24 * -1,
92  'expectedLabel' => '-1 day'
93  ],
94  'Plural negative days' => [
95  'seconds' => 60 * 60 * 24 * 2 * -1,
96  'expectedLabel' => '-2 days'
97  ],
98  'Single hour' => [
99  'seconds' => 60 * 60,
100  'expectedLabel' => '1 hour'
101  ],
102  'Plural hours' => [
103  'seconds' => 60 * 60 * 2,
104  'expectedLabel' => '2 hrs'
105  ],
106  'Single negative hour' => [
107  'seconds' => 60 * 60 * -1,
108  'expectedLabel' => '-1 hour'
109  ],
110  'Plural negative hours' => [
111  'seconds' => 60 * 60 * 2 * -1,
112  'expectedLabel' => '-2 hrs'
113  ],
114  'Single minute' => [
115  'seconds' => 60,
116  'expectedLabel' => '1 min'
117  ],
118  'Plural minutes' => [
119  'seconds' => 60 * 2,
120  'expectedLabel' => '2 min'
121  ],
122  'Single negative minute' => [
123  'seconds' => 60 * -1,
124  'expectedLabel' => '-1 min'
125  ],
126  'Plural negative minutes' => [
127  'seconds' => 60 * 2 * -1,
128  'expectedLabel' => '-2 min'
129  ],
130  'Zero seconds' => [
131  'seconds' => 0,
132  'expectedLabel' => '0 min'
133  ]
134  ];
135  }
136 
144  public function ‪calcAgeReturnsExpectedValues($seconds, $expectedLabel)
145  {
146  self::assertSame($expectedLabel, ‪BackendUtility::calcAge($seconds));
147  }
148 
150  // Tests concerning getProcessedValue
152 
157  {
158  ‪$GLOBALS['TCA'] = [
159  'tt_content' => [
160  'columns' => [
161  'header' => [
162  'config' => [
163  'type' => 'input',
164  ],
165  ],
166  ],
167  ],
168  ];
169  ‪$GLOBALS['LANG'] = [];
170  self::assertEquals('0', ‪BackendUtility::getProcessedValue('tt_content', 'header', '0'));
171  }
172 
176  public function ‪getProcessedValueForGroup()
177  {
178  ‪$GLOBALS['TCA'] = [
179  'tt_content' => [
180  'columns' => [
181  'multimedia' => [
182  'config' => [
183  'type' => 'group',
184  ],
185  ],
186  ],
187  ],
188  ];
189  ‪$GLOBALS['LANG'] = [];
190  self::assertSame('1, 2', ‪BackendUtility::getProcessedValue('tt_content', 'multimedia', '1,2'));
191  }
192 
197  {
198  ‪$GLOBALS['TCA'] = [
199  'tt_content' => [
200  'columns' => [
201  'pages' => [
202  'config' => [
203  'type' => 'group',
204  'allowed' => 'pages',
205  'internal_type' => 'db',
206  'maxitems' => 22,
207  'minitems' => 0,
208  'size' => 3,
209  ],
210  ],
211  ],
212  ],
213  ];
214  ‪$GLOBALS['LANG'] = [];
215  self::assertSame('Page 1, Page 2', ‪ProcessedValueForGroupWithOneAllowedTableFixture::getProcessedValue('tt_content', 'pages', '1,2'));
216  }
217 
222  {
223  ‪$GLOBALS['TCA'] = [
224  'index_config' => [
225  'columns' => [
226  'indexcfgs' => [
227  'config' => [
228  'type' => 'group',
229  'internal_type' => 'db',
230  'allowed' => 'index_config,pages',
231  'size' => 5,
232  ],
233  ],
234  ],
235  ],
236  ];
237  ‪$GLOBALS['LANG'] = [];
238  self::assertSame('Page 1, Configuration 2', ‪ProcessedValueForGroupWithMultipleAllowedTablesFixture::getProcessedValue('index_config', 'indexcfgs', 'pages_1,index_config_2'));
239  }
240 
248  protected function ‪mockDatabaseConnection($tableName = 'sys_category')
249  {
250  $connectionProphet = $this->prophesize(Connection::class);
251  $connectionProphet->quote(Argument::cetera())->will(function ($arguments) {
252  return "'" . $arguments[0] . "'";
253  });
254  $connectionProphet->quoteIdentifier(Argument::cetera())->will(function ($arguments) {
255  return '`' . $arguments[0] . '`';
256  });
257 
258  $restrictionProphet = $this->prophesize(DefaultRestrictionContainer::class);
259  $restrictionProphet->removeAll()->willReturn($restrictionProphet->reveal());
260  $restrictionProphet->add(Argument::cetera())->willReturn($restrictionProphet->reveal());
261 
262  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
263  $queryBuilderProphet->expr()->willReturn(
264  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
265  );
266  $queryBuilderProphet->getRestrictions()->willReturn($restrictionProphet->reveal());
267  $queryBuilderProphet->quoteIdentifier(Argument::cetera())->will(function ($arguments) {
268  return '`' . $arguments[0] . '`';
269  });
270 
271  $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
272  $connectionPoolProphet->getConnectionForTable($tableName)
273  ->willReturn($connectionProphet->reveal());
274  $connectionPoolProphet->getQueryBuilderForTable($tableName)
275  ->shouldBeCalled()
276  ->willReturn($queryBuilderProphet->reveal());
277 
278  return [$queryBuilderProphet, $connectionPoolProphet, $connectionProphet, $restrictionProphet];
279  }
280 
285  {
287  $relationHandlerProphet = $this->prophesize(RelationHandler::class);
288  $relationHandlerProphet->start(Argument::cetera())->shouldBeCalled();
289 
290  $relationHandlerInstance = $relationHandlerProphet->reveal();
291  $relationHandlerInstance->tableArray['sys_category'] = [1, 2];
292 
293  [$queryBuilderProphet, $connectionPoolProphet] = $this->‪mockDatabaseConnection('sys_category');
294  $statementProphet = $this->prophesize(Statement::class);
295  $statementProphet->fetch()->shouldBeCalled()->willReturn(
296  [
297  'uid' => 1,
298  'title' => 'Category 1',
299  ],
300  [
301  'uid' => 2,
302  'title' => 'Category 2',
303  ],
304  false
305  );
306 
308  $queryBuilderProphet->select('uid', 'sys_category.title')->willReturn($queryBuilderProphet->reveal());
309  $queryBuilderProphet->from('sys_category')->willReturn($queryBuilderProphet->reveal());
310  $queryBuilderProphet->where('`uid` IN (:dcValue1)')->willReturn($queryBuilderProphet->reveal());
311  $queryBuilderProphet->createNamedParameter([1, 2], Connection::PARAM_INT_ARRAY)->willReturn(':dcValue1');
312  $queryBuilderProphet->execute()->willReturn($statementProphet->reveal());
313 
314  GeneralUtility::addInstance(RelationHandler::class, $relationHandlerInstance);
315  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
316 
317  ‪$GLOBALS['TCA'] = [
318  'pages' => [
319  'columns' => [
320  'categories' => [
321  'config' => [
322  'type' => 'select',
323  'foreign_table' => 'sys_category',
324  'MM' => 'sys_category_record_mm',
325  'MM_match_fields' => [
326  'fieldname' => 'categories',
327  'tablesnames' => 'pages',
328  ],
329  'MM_opposite_field' => 'items',
330  ],
331  ],
332  ],
333  ],
334  'sys_category' => [
335  'ctrl' => ['label' => 'title'],
336  'columns' => [
337  'items' => [
338  'config' => [
339  'type' => 'group',
340  'internal_type' => 'db',
341  'allowed' => '*',
342  'MM' => 'sys_category_record_mm',
343  'MM_oppositeUsage' => [],
344  ]
345  ]
346  ],
347  ],
348  ];
349  ‪$GLOBALS['LANG'] = [];
350 
351  self::assertSame(
352  'Category 1; Category 2',
354  'pages',
355  'categories',
356  '2',
357  0,
358  false,
359  false,
360  1
361  )
362  );
363  }
364 
369  {
371  $languageServiceProphecy = $this->prophesize(LanguageService::class);
372  $languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
373  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
374 
375  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 8, 30, 2015);
376 
377  ‪$GLOBALS['TCA'] = [
378  'tt_content' => [
379  'columns' => [
380  'date' => [
381  'config' => [
382  'type' => 'input',
383  'eval' => 'date',
384  ],
385  ],
386  ],
387  ],
388  ];
389  self::assertSame('28-08-15 (-2 days)', ‪BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
390  }
391 
395  public function ‪inputTypeDateDisplayOptions()
396  {
397  return [
398  'typeSafe Setting' => [
399  true,
400  '28-08-15',
401  ],
402  'non typesafe setting' => [
403  1,
404  '28-08-15',
405  ],
406  'setting disabled typesafe' => [
407  false,
408  '28-08-15 (-2 days)',
409  ],
410  'setting disabled not typesafe' => [
411  0,
412  '28-08-15 (-2 days)',
413  ],
414  ];
415  }
416 
425  public function ‪getProcessedValueHandlesAgeDisplayCorrectly($input, $expected)
426  {
428  $languageServiceProphecy = $this->prophesize(LanguageService::class);
429  $languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
430  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
431 
432  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 8, 30, 2015);
433 
434  ‪$GLOBALS['TCA'] = [
435  'tt_content' => [
436  'columns' => [
437  'date' => [
438  'config' => [
439  'type' => 'input',
440  'eval' => 'date',
441  'disableAgeDisplay' => $input,
442  ],
443  ],
444  ],
445  ],
446  ];
447  self::assertSame($expected, ‪BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
448  }
449 
454  {
455  ‪$GLOBALS['TCA'] = [
456  'tt_content' => [
457  'columns' => [
458  'hide' => [
459  'config' => [
460  'type' => 'check',
461  'items' => [
462  [
463  0 => '',
464  1 => '',
465  ]
466  ]
467  ]
468  ]
469  ]
470  ]
471  ];
472  $languageServiceProphecy = $this->prophesize(LanguageService::class);
473  $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes')->willReturn('Yes');
474  $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no')->willReturn('No');
475  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
476  self::assertSame('Yes', ‪BackendUtility::getProcessedValue('tt_content', 'hide', 1));
477  }
478 
483  {
484  ‪$GLOBALS['TCA'] = [
485  'tt_content' => [
486  'columns' => [
487  'hide' => [
488  'config' => [
489  'type' => 'check',
490  'items' => [
491  [
492  0 => '',
493  1 => '',
494  'invertStateDisplay' => true,
495  ]
496  ]
497  ]
498  ]
499  ]
500  ]
501  ];
502  $languageServiceProphecy = $this->prophesize(LanguageService::class);
503  $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes')->willReturn('Yes');
504  $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no')->willReturn('No');
505  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
506  self::assertSame('No', ‪BackendUtility::getProcessedValue('tt_content', 'hide', 1));
507  }
508 
519  {
520  return [
521  'only uid' => [
522  'table' => 'test_table',
523  'prefix' => '',
524  'presetFields' => [],
525  'tca' => [],
526  'expectedFields' => 'uid'
527  ],
528  'label set' => [
529  'table' => 'test_table',
530  'prefix' => '',
531  'presetFields' => [],
532  'tca' => [
533  'ctrl' => [
534  'label' => 'label'
535  ]
536  ],
537  'expectedFields' => 'uid,label'
538  ],
539  'label_alt set' => [
540  'table' => 'test_table',
541  'prefix' => '',
542  'presetFields' => [],
543  'tca' => [
544  'ctrl' => [
545  'label_alt' => 'label,label2'
546  ]
547  ],
548  'expectedFields' => 'uid,label,label2'
549  ],
550  'versioningWS set' => [
551  'table' => 'test_table',
552  'prefix' => '',
553  'presetFields' => [],
554  'tca' => [
555  'ctrl' => [
556  'versioningWS' => true
557  ]
558  ],
559  'expectedFields' => 'uid,t3ver_state,t3ver_wsid,t3ver_count'
560  ],
561  'selicon_field set' => [
562  'table' => 'test_table',
563  'prefix' => '',
564  'presetFields' => [],
565  'tca' => [
566  'ctrl' => [
567  'selicon_field' => 'field'
568  ]
569  ],
570  'expectedFields' => 'uid,field'
571  ],
572  'typeicon_column set' => [
573  'table' => 'test_table',
574  'prefix' => '',
575  'presetFields' => [],
576  'tca' => [
577  'ctrl' => [
578  'typeicon_column' => 'field'
579  ]
580  ],
581  'expectedFields' => 'uid,field'
582  ],
583  'enablecolumns set' => [
584  'table' => 'test_table',
585  'prefix' => '',
586  'presetFields' => [],
587  'tca' => [
588  'ctrl' => [
589  'enablecolumns' => [
590  'disabled' => 'hidden',
591  'starttime' => 'start',
592  'endtime' => 'stop',
593  'fe_group' => 'groups'
594  ]
595  ]
596  ],
597  'expectedFields' => 'uid,hidden,start,stop,groups'
598  ],
599  'label set to uid' => [
600  'table' => 'test_table',
601  'prefix' => '',
602  'presetFields' => [],
603  'tca' => [
604  'ctrl' => [
605  'label' => 'uid'
606  ]
607  ],
608  'expectedFields' => 'uid'
609  ]
610  ];
611  }
612 
623  public function ‪getCommonSelectFieldsReturnsCorrectFields($table, $prefix = '', array $presetFields, array ‪$tca, $expectedFields = '')
624  {
625  ‪$GLOBALS['TCA'][$table] = ‪$tca;
626  $selectFields = ‪BackendUtility::getCommonSelectFields($table, $prefix, $presetFields);
627  self::assertEquals($selectFields, $expectedFields);
628  }
629 
640  {
641  return [
642  'item set' => [
643  'table' => 'tt_content',
644  'col' => 'menu_type',
645  'key' => '1',
646  'tca' => [
647  'columns' => [
648  'menu_type' => [
649  'config' => [
650  'items' => [
651  ['Item 1', '0'],
652  ['Item 2', '1'],
653  ['Item 3', '3']
654  ]
655  ]
656  ]
657  ]
658  ],
659  'expectedLabel' => 'Item 2'
660  ],
661  'item set twice' => [
662  'table' => 'tt_content',
663  'col' => 'menu_type',
664  'key' => '1',
665  'tca' => [
666  'columns' => [
667  'menu_type' => [
668  'config' => [
669  'items' => [
670  ['Item 1', '0'],
671  ['Item 2a', '1'],
672  ['Item 2b', '1'],
673  ['Item 3', '3']
674  ]
675  ]
676  ]
677  ]
678  ],
679  'expectedLabel' => 'Item 2a'
680  ],
681  'item not found' => [
682  'table' => 'tt_content',
683  'col' => 'menu_type',
684  'key' => '5',
685  'tca' => [
686  'columns' => [
687  'menu_type' => [
688  'config' => [
689  'items' => [
690  ['Item 1', '0'],
691  ['Item 2', '1'],
692  ['Item 3', '2']
693  ]
694  ]
695  ]
696  ]
697  ],
698  'expectedLabel' => null
699  ]
700  ];
701  }
702 
713  public function ‪getLabelFromItemlistReturnsCorrectFields($table, $col = '', $key = '', array ‪$tca, $expectedLabel = '')
714  {
715  ‪$GLOBALS['TCA'][$table] = ‪$tca;
716  $label = ‪BackendUtility::getLabelFromItemlist($table, $col, $key);
717  self::assertEquals($label, $expectedLabel);
718  }
719 
730  {
731  return [
732  'no field found' => [
733  'pageId' => '123',
734  'table' => 'tt_content',
735  'col' => 'menu_type',
736  'key' => '10',
737  'tca' => [
738  'columns' => [
739  'menu_type' => [
740  'config' => [
741  'items' => [
742  ['Item 1', '0'],
743  ['Item 2', '1'],
744  ['Item 3', '3']
745  ]
746  ]
747  ]
748  ]
749  ],
750  'expectedLabel' => ''
751  ],
752  'no tsconfig set' => [
753  'pageId' => '123',
754  'table' => 'tt_content',
755  'col' => 'menu_type',
756  'key' => '1',
757  'tca' => [
758  'columns' => [
759  'menu_type' => [
760  'config' => [
761  'items' => [
762  ['Item 1', '0'],
763  ['Item 2', '1'],
764  ['Item 3', '3']
765  ]
766  ]
767  ]
768  ]
769  ],
770  'expectedLabel' => 'Item 2'
771  ]
772  ];
773  }
774 
786  public function ‪getLabelFromItemListMergedReturnsCorrectFields($pageId, $table, $column = '', $key = '', array ‪$tca, $expectedLabel = '')
787  {
788  ‪$GLOBALS['TCA'][$table] = ‪$tca;
789 
790  self::assertEquals($expectedLabel, ‪LabelFromItemListMergedReturnsCorrectFieldsFixture::getLabelFromItemListMerged($pageId, $table, $column, $key));
791  }
792 
801  {
802  self::assertStringMatchesFormat('<input %Svalue="1"%S/>', ‪BackendUtility::getFuncCheck('params', 'test', true));
803  }
804 
805  /*
806  * Tests concerning getLabelsFromItemsList
807  */
808 
812  public function ‪getLabelsFromItemsListDataProvider()
813  {
814  return [
815  'return value if found' => [
816  'foobar', // table
817  'someColumn', // col
818  'foo, bar', // keyList
819  [ // TCA
820  'columns' => [
821  'someColumn' => [
822  'config' => [
823  'items' => [
824  '0' => ['aFooLabel', 'foo'],
825  '1' => ['aBarLabel', 'bar']
826  ]
827  ]
828  ]
829  ]
830  ],
831  [], // page TSconfig
832  'aFooLabel, aBarLabel' // expected
833  ],
834  'page TSconfig overrules TCA' => [
835  'foobar', // table
836  'someColumn', // col
837  'foo,bar, add', // keyList
838  [ // TCA
839  'columns' => [
840  'someColumn' => [
841  'config' => [
842  'items' => [
843  '0' => ['aFooLabel', 'foo'],
844  '1' => ['aBarLabel', 'bar']
845  ]
846  ]
847  ]
848  ]
849  ],
850  [ // page TSconfig
851  'addItems.' => ['add' => 'aNewLabel'],
852  'altLabels.' => ['bar' => 'aBarDiffLabel'],
853  ],
854  'aFooLabel, aBarDiffLabel, aNewLabel' // expected
855  ]
856  ];
857  }
858 
870  public function ‪getLabelsFromItemsListReturnsCorrectValue($table, $col, $keyList, ‪$tca, array $pageTsConfig, $expectedLabel)
871  {
872  // Stub LanguageService and let sL() return the same value that came in again
873  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
874  ‪$GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
875 
876  ‪$GLOBALS['TCA'][$table] = ‪$tca;
877  $label = ‪BackendUtility::getLabelsFromItemsList($table, $col, $keyList, $pageTsConfig);
878  self::assertEquals($expectedLabel, $label);
879  }
880 
885  {
886  $table = 'foobar';
887  $col = 'someColumn';
888  ‪$tca = [
889  'columns' => [
890  'someColumn' => [
891  'config' => [
892  'type' => 'select',
893  'items' => [
894  '0' => ['aFooLabel', 'foo'],
895  '1' => ['aBarLabel', 'bar']
896  ]
897  ]
898  ]
899  ]
900  ];
901  // Stub LanguageService and let sL() return the same value that came in again
902  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
903  ‪$GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
904 
905  ‪$GLOBALS['TCA'][$table] = ‪$tca;
906  $label = ‪BackendUtility::getProcessedValue($table, $col, 'foo,invalidKey,bar');
907  self::assertEquals('aFooLabel, aBarLabel', $label);
908  }
909 
914  {
915  $table = 'foobar';
916  $col = 'someColumn';
917  ‪$tca = [
918  'columns' => [
919  'someColumn' => [
920  'config' => [
921  'type' => 'select',
922  'items' => [
923  '0' => ['aFooLabel', 'foo']
924  ]
925  ]
926  ]
927  ]
928  ];
929  // Stub LanguageService and let sL() return the same value that came in again
930  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
931  ‪$GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
932 
933  ‪$GLOBALS['TCA'][$table] = ‪$tca;
934  $label = ‪BackendUtility::getProcessedValue($table, $col, 'invalidKey');
935  self::assertEquals('invalidKey', $label);
936  }
937 
946  {
947  // Make sure the hook inside viewOnClick is not fired. This may be removed if unit tests
948  // bootstrap does not initialize TYPO3_CONF_VARS anymore.
949  unset(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']);
950 
951  $alternativeUrl = 'https://typo3.org/about/typo3-the-cms/the-history-of-typo3/#section';
952  $onclickCode = 'var previewWin = window.open(' . GeneralUtility::quoteJSvalue($alternativeUrl) . ',\'newTYPO3frontendWindow\');' . LF
953  . 'if (previewWin.location.href === ' . GeneralUtility::quoteJSvalue($alternativeUrl) . ') { previewWin.location.reload(); };';
954  self::assertStringMatchesFormat(
955  $onclickCode,
956  ‪BackendUtility::viewOnClick(null, null, null, null, $alternativeUrl, null, false)
957  );
958  }
959 
963  public function ‪dateTimeAgeReturnsCorrectValues()
964  {
966  $languageServiceProphecy = $this->prophesize(LanguageService::class);
967  $languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
968  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
969  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 3, 23, 2016);
970 
971  self::assertSame('24-03-16 00:00 (-1 day)', ‪BackendUtility::dateTimeAge(‪$GLOBALS['EXEC_TIME'] + 86400));
972  self::assertSame('24-03-16 (-1 day)', ‪BackendUtility::dateTimeAge(‪$GLOBALS['EXEC_TIME'] + 86400, 1, 'date'));
973  }
974 
979  {
980  $propertyNames = [
981  'uid',
982  'pid',
983  '_ORIG_PID'
984  ];
985  $computedPropertyNames = ‪BackendUtility::purgeComputedPropertyNames($propertyNames);
986  self::assertSame(['uid', 'pid'], $computedPropertyNames);
987  }
988 
993  {
994  $record = [
995  'uid' => 1,
996  'pid' => 2,
997  '_ORIG_PID' => 1
998  ];
999  $expected = [
1000  'uid' => 1,
1001  'pid' => 2
1002  ];
1003  $computedProperties = ‪BackendUtility::purgeComputedPropertiesFromRecord($record);
1004  self::assertSame($expected, $computedProperties);
1005  }
1007  public function ‪splitTableUidDataProvider()
1008  {
1009  return [
1010  'simple' => [
1011  'pages_23',
1012  ['pages', '23']
1013  ],
1014  'complex' => [
1015  'tt_content_13',
1016  ['tt_content', '13']
1017  ],
1018  'multiple underscores' => [
1019  'tx_runaway_domain_model_crime_scene_1234',
1020  ['tx_runaway_domain_model_crime_scene', '1234']
1021  ]
1022  ];
1023  }
1024 
1029  public function ‪splitTableUid($input, $expected)
1030  {
1031  $result = ‪BackendUtility::splitTable_Uid($input);
1032  self::assertSame($expected, $result);
1033  }
1034 
1042  {
1043  $expected = ['called.' => ['config']];
1044  $pageId = 13;
1045  $eventDispatcherProphecy = $this->prophesize(EventDispatcherInterface::class);
1046  $eventDispatcherProphecy->dispatch(Argument::any())->willReturn(new ModifyLoadedPageTsConfigEvent([], []));
1047  $loader = new PageTsConfigLoader($eventDispatcherProphecy->reveal());
1048  GeneralUtility::addInstance(PageTsConfigLoader::class, $loader);
1049  $parserProphecy = $this->prophesize(PageTsConfigParser::class);
1050  $parserProphecy->parse(Argument::cetera())->willReturn($expected);
1051  GeneralUtility::addInstance(PageTsConfigParser::class, $parserProphecy->reveal());
1052 
1053  $matcherProphecy = $this->prophesize(ConditionMatcher::class);
1054  GeneralUtility::addInstance(ConditionMatcher::class, $matcherProphecy->reveal());
1055 
1056  $siteFinder = $this->prophesize(SiteFinder::class);
1057  $siteFinder->getSiteByPageId($pageId)->willReturn(
1058  new Site('dummy', $pageId, ['base' => 'https://example.com'])
1059  );
1060  GeneralUtility::addInstance(SiteFinder::class, $siteFinder->reveal());
1061 
1062  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
1063  $cacheProphecy = $this->prophesize(FrontendInterface::class);
1064  $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
1065  $cacheHashProphecy = $this->prophesize(FrontendInterface::class);
1066  $cacheManagerProphecy->getCache('hash')->willReturn($cacheHashProphecy->reveal());
1067  $cacheProphecy->has(Argument::cetera())->willReturn(false);
1068  $cacheProphecy->get(Argument::cetera())->willReturn(false);
1069  $cacheProphecy->set(Argument::cetera())->willReturn(false);
1070  $cacheProphecy->get('backendUtilityBeGetRootLine')->willReturn(['13--1' => []]);
1071  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
1072 
1073  $result = ‪BackendUtility::getPagesTSconfig($pageId);
1074  self::assertEquals($expected, $result);
1075  }
1076 
1081  {
1082  $tableName = 'table_a';
1083  $fieldName = 'field_a';
1084  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = [];
1085  self::assertNull(‪BackendUtility::resolveFileReferences($tableName, $fieldName, []));
1086  }
1087 
1092  {
1093  ‪$GLOBALS['BE_USER'] = null;
1094  $tableName = 'table_a';
1095  ‪$GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] = 'not_empty';
1096  $rr = [
1097  'pid' => -1,
1098  't3ver_oid' => 7,
1099  't3ver_wsid' => 42,
1100  't3ver_state' => 0
1101  ];
1102  $reference = $rr;
1103  ‪BackendUtility::fixVersioningPid($tableName, $rr);
1104  self::assertSame($reference, $rr);
1105  }
1106 
1111  public function ‪returnNullForUnfitTableConfigInResolveFileReferences(array $config)
1112  {
1113  $tableName = 'table_a';
1114  $fieldName = 'field_a';
1115  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = $config;
1116  self::assertNull(‪BackendUtility::resolveFileReferences($tableName, $fieldName, []));
1117  }
1119  public function ‪unfitResolveFileReferencesTableConfig(): array
1120  {
1121  return [
1122  'invalid table' => [
1123  [
1124  'type' => 'inline',
1125  'foreign_table' => 'table_b',
1126  ],
1127  ],
1128  'empty table' => [
1129  [
1130  'type' => 'inline',
1131  'foreign_table' => '',
1132  ],
1133  ],
1134  'invalid type' => [
1135  [
1136  'type' => 'select',
1137  'foreign_table' => 'sys_file_reference',
1138  ],
1139  ],
1140  'empty type' => [
1141  [
1142  'type' => '',
1143  'foreign_table' => 'sys_file_reference',
1144  ],
1145  ],
1146  'empty' => [
1147  [
1148  'type' => '',
1149  'foreign_table' => '',
1150  ],
1151  ],
1152  ];
1153  }
1154 
1159  {
1160  ‪$GLOBALS['BE_USER'] = null;
1161  $tableName = 'table_a';
1162  $row = [
1163  'uid' => 1,
1164  'pid' => 17,
1165  ];
1166  $reference = $row;
1167  ‪BackendUtility::workspaceOL($tableName, $row);
1168  self::assertSame($reference, $row);
1169  }
1170 
1175  {
1176  ‪$GLOBALS['BE_USER'] = null;
1177  $tableName = 'table_a';
1178  ‪$GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] = 'not_empty';
1179  self::assertSame('', ‪BackendUtility::versioningPlaceholderClause($tableName));
1180  }
1181 
1186  {
1187  $tableName = 'table_a';
1188  $fieldName = 'field_a';
1189  $relationHandler = $this->prophesize(RelationHandler::class);
1190  $relationHandler->start(
1191  'foo',
1192  'sys_file_reference',
1193  '',
1194  42,
1195  $tableName,
1196  ['type' => 'inline', 'foreign_table' => 'sys_file_reference']
1197  )->shouldBeCalled();
1198  $relationHandler->tableArray = ['sys_file_reference' => []];
1199  $relationHandler->processDeletePlaceholder()->shouldBeCalled();
1200  GeneralUtility::addInstance(RelationHandler::class, $relationHandler->reveal());
1201  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = [
1202  'type' => 'inline',
1203  'foreign_table' => 'sys_file_reference',
1204  ];
1205  $elementData = [
1206  $fieldName => 'foo',
1207  'uid' => 42,
1208  ];
1209 
1210  self::assertEmpty(‪BackendUtility::resolveFileReferences($tableName, $fieldName, $elementData));
1211  }
1212 
1217  {
1218  ‪$GLOBALS['BE_USER'] = null;
1219  $tableName = 'table_a';
1220  ‪$GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] = 'not_empty';
1221  self::assertSame('', ‪BackendUtility::getWorkspaceWhereClause($tableName));
1222  }
1223 
1228  {
1229  ‪$GLOBALS['BE_USER'] = null;
1230  $tableName = 'table_a';
1231  $uid = 42;
1232  self::assertSame(42, ‪BackendUtility::wsMapId($tableName, $uid));
1233  }
1234 
1239  {
1240  ‪$GLOBALS['BE_USER'] = null;
1241  $tableName = 'table_a';
1242  self::assertFalse(‪BackendUtility::getMovePlaceholder($tableName, 42));
1243  }
1244 }
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore
‪purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore()
Definition: BackendUtilityTest.php:977
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:35
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\mockDatabaseConnection
‪array mockDatabaseConnection($tableName='sys_category')
Definition: BackendUtilityTest.php:247
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getCommonSelectFieldsReturnsCorrectFields
‪getCommonSelectFieldsReturnsCorrectFields($table, $prefix='', array $presetFields, array $tca, $expectedFields='')
Definition: BackendUtilityTest.php:622
‪TYPO3\CMS\Backend\Utility\BackendUtility\resolveFileReferences
‪static TYPO3 CMS Core Resource FileReference[] null resolveFileReferences($tableName, $fieldName, $element, $workspaceId=null)
Definition: BackendUtility.php:1066
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForCheckWithSingleItem
‪getProcessedValueForCheckWithSingleItem()
Definition: BackendUtilityTest.php:452
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: BackendUtilityTest.php:52
‪TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures\ProcessedValueForGroupWithMultipleAllowedTablesFixture
Definition: ProcessedValueForGroupWithMultipleAllowedTablesFixture.php:24
‪TYPO3\CMS\Core\Database\RelationHandler
Definition: RelationHandler.php:35
‪TYPO3\CMS\Backend\Utility\BackendUtility\getCommonSelectFields
‪static string getCommonSelectFields($table, $prefix='', $fields=[])
Definition: BackendUtility.php:2136
‪TYPO3\CMS\Backend\Utility\BackendUtility\calcAge
‪static string calcAge($seconds, $labels='min|hrs|days|yrs|min|hour|day|year')
Definition: BackendUtility.php:1017
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroup
‪getProcessedValueForGroup()
Definition: BackendUtilityTest.php:175
‪TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
Definition: ConditionMatcher.php:30
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\viewOnClickReturnsOnClickCodeWithAlternativeUrl
‪viewOnClickReturnsOnClickCodeWithAlternativeUrl()
Definition: BackendUtilityTest.php:944
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroupWithOneAllowedTable
‪getProcessedValueForGroupWithOneAllowedTable()
Definition: BackendUtilityTest.php:195
‪TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader
Definition: PageTsConfigLoader.php:39
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\calcAgeReturnsExpectedValues
‪calcAgeReturnsExpectedValues($seconds, $expectedLabel)
Definition: BackendUtilityTest.php:143
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Backend\Utility\BackendUtility\purgeComputedPropertiesFromRecord
‪static array< string, mixed > purgeComputedPropertiesFromRecord(array $record)
Definition: BackendUtility.php:172
‪TYPO3\CMS\Backend\Utility\BackendUtility\purgeComputedPropertyNames
‪static array purgeComputedPropertyNames(array $propertyNames)
Definition: BackendUtility.php:190
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForZeroStringIsZero
‪getProcessedValueForZeroStringIsZero()
Definition: BackendUtilityTest.php:155
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelsFromItemsListDataProvider
‪array getLabelsFromItemsListDataProvider()
Definition: BackendUtilityTest.php:811
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\inputTypeDateDisplayOptions
‪array inputTypeDateDisplayOptions()
Definition: BackendUtilityTest.php:394
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\versioningPlaceholderClauseReturnsEmptyIfNoBeUserIsAvailable
‪versioningPlaceholderClauseReturnsEmptyIfNoBeUserIsAvailable()
Definition: BackendUtilityTest.php:1173
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForSelectWithMMRelation
‪getProcessedValueForSelectWithMMRelation()
Definition: BackendUtilityTest.php:283
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getCommonSelectFieldsReturnsCorrectFieldsDataProvider
‪array getCommonSelectFieldsReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:517
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroupWithMultipleAllowedTables
‪getProcessedValueForGroupWithMultipleAllowedTables()
Definition: BackendUtilityTest.php:220
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemListMergedReturnsCorrectFieldsDataProvider
‪array getLabelFromItemListMergedReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:728
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\dateTimeAgeReturnsCorrectValues
‪dateTimeAgeReturnsCorrectValues()
Definition: BackendUtilityTest.php:962
‪TYPO3\CMS\Backend\Utility\BackendUtility\getWorkspaceWhereClause
‪static string getWorkspaceWhereClause($table, $workspaceId=null)
Definition: BackendUtility.php:3805
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForCheckWithSingleItemInvertStateDisplay
‪getProcessedValueForCheckWithSingleItemInvertStateDisplay()
Definition: BackendUtilityTest.php:481
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:52
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:40
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getFuncCheckReturnsInputTagWithValueAttribute
‪getFuncCheckReturnsInputTagWithValueAttribute()
Definition: BackendUtilityTest.php:799
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getMovePlaceholderReturnsFalseIfNoBeUserIsAvailable
‪getMovePlaceholderReturnsFalseIfNoBeUserIsAvailable()
Definition: BackendUtilityTest.php:1237
‪TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures\ProcessedValueForGroupWithOneAllowedTableFixture
Definition: ProcessedValueForGroupWithOneAllowedTableFixture.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Utility
Definition: BackendUtilityTest.php:16
‪TYPO3\CMS\Backend\Utility\BackendUtility\fixVersioningPid
‪static fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch=false)
Definition: BackendUtility.php:3511
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\returnNullForUnfitTableConfigInResolveFileReferences
‪returnNullForUnfitTableConfigInResolveFileReferences(array $config)
Definition: BackendUtilityTest.php:1110
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\wsMapIdReturnsLiveIdIfNoBeUserIsAvailable
‪wsMapIdReturnsLiveIdIfNoBeUserIsAvailable()
Definition: BackendUtilityTest.php:1226
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueReturnsPlainValueIfItemIsNotFound
‪getProcessedValueReturnsPlainValueIfItemIsNotFound()
Definition: BackendUtilityTest.php:912
‪TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures\LabelFromItemListMergedReturnsCorrectFieldsFixture
Definition: LabelFromItemListMergedReturnsCorrectFieldsFixture.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent
‪getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent()
Definition: BackendUtilityTest.php:367
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\calcAgeDataProvider
‪array calcAgeDataProvider()
Definition: BackendUtilityTest.php:62
‪TYPO3\CMS\Backend\Utility\BackendUtility\versioningPlaceholderClause
‪static string versioningPlaceholderClause($table)
Definition: BackendUtility.php:3788
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getWorkspaceWhereClauseReturnsEmptyIfNoBeUserIsAvailable
‪getWorkspaceWhereClauseReturnsEmptyIfNoBeUserIsAvailable()
Definition: BackendUtilityTest.php:1215
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLabelFromItemListMerged
‪static string getLabelFromItemListMerged($pageId, $table, $column, $key)
Definition: BackendUtility.php:1434
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig
‪static array getPagesTSconfig($id)
Definition: BackendUtility.php:698
‪TYPO3\CMS\Backend\Utility\BackendUtility\getFuncCheck
‪static string getFuncCheck( $mainParams, $elementName, $currentValue, $script='', $addParams='', $tagParams='')
Definition: BackendUtility.php:2709
‪TYPO3\CMS\Backend\Utility\BackendUtility\getMovePlaceholder
‪static array bool getMovePlaceholder($table, $uid, $fields=' *', $workspace=null)
Definition: BackendUtility.php:3851
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:35
‪TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser
Definition: PageTsConfigParser.php:33
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable
‪resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable()
Definition: BackendUtilityTest.php:1184
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getPagesTSconfigWorksWithoutInitializedBackendUser
‪getPagesTSconfigWorksWithoutInitializedBackendUser()
Definition: BackendUtilityTest.php:1040
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures\ProcessedValueForSelectWithMMRelationFixture
Definition: ProcessedValueForSelectWithMMRelationFixture.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\unfitResolveFileReferencesTableConfig
‪unfitResolveFileReferencesTableConfig()
Definition: BackendUtilityTest.php:1118
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\fixVersioningPidDoesNotChangeValuesForNoBeUserAvailable
‪fixVersioningPidDoesNotChangeValuesForNoBeUserAvailable()
Definition: BackendUtilityTest.php:1090
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemlistReturnsCorrectFieldsDataProvider
‪array getLabelFromItemlistReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:638
‪TYPO3\CMS\Backend\Utility\BackendUtility\dateTimeAge
‪static string dateTimeAge($tstamp, $prefix=1, $date='')
Definition: BackendUtility.php:1047
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:22
‪TYPO3\CMS\Backend\Utility\BackendUtility\viewOnClick
‪static string viewOnClick( $pageUid, $backPath='', $rootLine=null, $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=true)
Definition: BackendUtility.php:2359
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemlistReturnsCorrectFields
‪getLabelFromItemlistReturnsCorrectFields($table, $col='', $key='', array $tca, $expectedLabel='')
Definition: BackendUtilityTest.php:712
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLabelsFromItemsList
‪static string getLabelsFromItemsList($table, $column, $keyList, array $columnTsConfig=[])
Definition: BackendUtility.php:1472
‪TYPO3\CMS\Backend\Utility\BackendUtility\getProcessedValue
‪static string null getProcessedValue( $table, $col, $value, $fixed_lgd_chars=0, $defaultPassthrough=false, $noRecordLookup=false, $uid=0, $forceResult=true, $pid=0)
Definition: BackendUtility.php:1664
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\splitTableUid
‪splitTableUid($input, $expected)
Definition: BackendUtilityTest.php:1028
‪TYPO3\CMS\Core\Configuration\Event\ModifyLoadedPageTsConfigEvent
Definition: ModifyLoadedPageTsConfigEvent.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Utility\BackendUtility\workspaceOL
‪static workspaceOL($table, &$row, $wsid=-99, $unsetMovePointers=false)
Definition: BackendUtility.php:3586
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLabelFromItemlist
‪static string getLabelFromItemlist($table, $col, $key)
Definition: BackendUtility.php:1410
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\workspaceOLDoesNotChangeValuesForNoBeUserAvailable
‪workspaceOLDoesNotChangeValuesForNoBeUserAvailable()
Definition: BackendUtilityTest.php:1157
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore
‪purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore()
Definition: BackendUtilityTest.php:991
‪$tca
‪$tca
Definition: sys_file_metadata.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemListMergedReturnsCorrectFields
‪getLabelFromItemListMergedReturnsCorrectFields($pageId, $table, $column='', $key='', array $tca, $expectedLabel='')
Definition: BackendUtilityTest.php:785
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\returnNullForMissingTcaConfigInResolveFileReferences
‪returnNullForMissingTcaConfigInResolveFileReferences()
Definition: BackendUtilityTest.php:1079
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueHandlesAgeDisplayCorrectly
‪getProcessedValueHandlesAgeDisplayCorrectly($input, $expected)
Definition: BackendUtilityTest.php:424
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest
Definition: BackendUtilityTest.php:49
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueReturnsLabelsForExistingValuesSolely
‪getProcessedValueReturnsLabelsForExistingValuesSolely()
Definition: BackendUtilityTest.php:883
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelsFromItemsListReturnsCorrectValue
‪getLabelsFromItemsListReturnsCorrectValue($table, $col, $keyList, $tca, array $pageTsConfig, $expectedLabel)
Definition: BackendUtilityTest.php:869
‪TYPO3\CMS\Backend\Utility\BackendUtility\wsMapId
‪static int wsMapId($table, $uid)
Definition: BackendUtility.php:3827
‪TYPO3\CMS\Backend\Utility\BackendUtility\splitTable_Uid
‪static array splitTable_Uid($str)
Definition: BackendUtility.php:208
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\splitTableUidDataProvider
‪splitTableUidDataProvider()
Definition: BackendUtilityTest.php:1006
‪TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer
Definition: DefaultRestrictionContainer.php:24