‪TYPO3CMS  ‪main
BackendUtilityTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
23 use TYPO3\CMS\Backend\Utility\BackendUtility;
34 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
35 
36 final class ‪BackendUtilityTest extends UnitTestCase
37 {
38  protected bool ‪$resetSingletonInstances = true;
39 
41  // Tests concerning calcAge
43 
46  public static function ‪calcAgeDataProvider(): array
47  {
48  return [
49  'Single year' => [
50  'seconds' => 60 * 60 * 24 * 365,
51  'expectedLabel' => '1 year',
52  ],
53  'Plural years' => [
54  'seconds' => 60 * 60 * 24 * 365 * 2,
55  'expectedLabel' => '2 yrs',
56  ],
57  'Single negative year' => [
58  'seconds' => 60 * 60 * 24 * 365 * -1,
59  'expectedLabel' => '-1 year',
60  ],
61  'Plural negative years' => [
62  'seconds' => 60 * 60 * 24 * 365 * 2 * -1,
63  'expectedLabel' => '-2 yrs',
64  ],
65  'Single day' => [
66  'seconds' => 60 * 60 * 24,
67  'expectedLabel' => '1 day',
68  ],
69  'Plural days' => [
70  'seconds' => 60 * 60 * 24 * 2,
71  'expectedLabel' => '2 days',
72  ],
73  'Single negative day' => [
74  'seconds' => 60 * 60 * 24 * -1,
75  'expectedLabel' => '-1 day',
76  ],
77  'Plural negative days' => [
78  'seconds' => 60 * 60 * 24 * 2 * -1,
79  'expectedLabel' => '-2 days',
80  ],
81  'Single hour' => [
82  'seconds' => 60 * 60,
83  'expectedLabel' => '1 hour',
84  ],
85  'Plural hours' => [
86  'seconds' => 60 * 60 * 2,
87  'expectedLabel' => '2 hrs',
88  ],
89  'Single negative hour' => [
90  'seconds' => 60 * 60 * -1,
91  'expectedLabel' => '-1 hour',
92  ],
93  'Plural negative hours' => [
94  'seconds' => 60 * 60 * 2 * -1,
95  'expectedLabel' => '-2 hrs',
96  ],
97  'Single minute' => [
98  'seconds' => 60,
99  'expectedLabel' => '1 min',
100  ],
101  'Plural minutes' => [
102  'seconds' => 60 * 2,
103  'expectedLabel' => '2 min',
104  ],
105  'Single negative minute' => [
106  'seconds' => 60 * -1,
107  'expectedLabel' => '-1 min',
108  ],
109  'Plural negative minutes' => [
110  'seconds' => 60 * 2 * -1,
111  'expectedLabel' => '-2 min',
112  ],
113  'Zero seconds' => [
114  'seconds' => 0,
115  'expectedLabel' => '0 min',
116  ],
117  ];
118  }
119 
120  #[DataProvider('calcAgeDataProvider')]
121  #[Test]
122  public function ‪calcAgeReturnsExpectedValues(int $seconds, string $expectedLabel): void
123  {
124  self::assertSame($expectedLabel, BackendUtility::calcAge($seconds));
125  }
126 
128  // Tests concerning getProcessedValue
130 
133  #[Test]
135  {
136  ‪$GLOBALS['TCA'] = [
137  'tt_content' => [
138  'columns' => [
139  'header' => [
140  'config' => [
141  'type' => 'input',
142  ],
143  ],
144  ],
145  ],
146  ];
147 
148  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
149 
150  self::assertEquals('0', BackendUtility::getProcessedValue('tt_content', 'header', '0'));
151  }
152 
153  #[Test]
154  public function ‪getProcessedValueForGroup(): void
155  {
156  ‪$GLOBALS['TCA'] = [
157  'tt_content' => [
158  'columns' => [
159  'multimedia' => [
160  'config' => [
161  'type' => 'group',
162  ],
163  ],
164  ],
165  ],
166  ];
167  $languageServiceMock = $this->createMock(LanguageService::class);
168  $languageServiceMock->expects(self::once())->method('sL')->willReturn('testLabel');
169  ‪$GLOBALS['LANG'] = $languageServiceMock;
170  self::assertSame('testLabel', BackendUtility::getProcessedValue('tt_content', 'multimedia', '1,2'));
171  }
172 
173  #[Test]
174  public function ‪getProcessedValueForFlexNull(): void
175  {
176  ‪$GLOBALS['TCA'] = [
177  'tt_content' => [
178  'columns' => [
179  'pi_flexform' => [
180  'config' => [
181  'type' => 'flex',
182  ],
183  ],
184  ],
185  ],
186  ];
187  $languageServiceMock = $this->createMock(LanguageService::class);
188  $languageServiceMock->method('sL')->willReturn('testLabel');
189  ‪$GLOBALS['LANG'] = $languageServiceMock;
190  self::assertSame('', BackendUtility::getProcessedValue('tt_content', 'pi_flexform', null));
191  }
192 
193  #[Test]
195  {
196  ‪$GLOBALS['TCA'] = [
197  'tt_content' => [
198  'columns' => [
199  'header' => [
200  'config' => [
201  'type' => 'datetime',
202  'dbType' => 'date',
203  'format' => 'date',
204  ],
205  ],
206  ],
207  ],
208  ];
209  $languageServiceMock = $this->createMock(LanguageService::class);
210  $languageServiceMock->method('sL')->willReturn('testLabel');
211  ‪$GLOBALS['LANG'] = $languageServiceMock;
212  self::assertSame('', BackendUtility::getProcessedValue('tt_content', 'header', null));
213  }
214 
215  #[Test]
217  {
218  ‪$GLOBALS['TCA'] = [
219  'tt_content' => [
220  'columns' => [
221  'header' => [
222  'config' => [
223  'type' => 'datetime',
224  'dbType' => 'datetime',
225  ],
226  ],
227  ],
228  ],
229  ];
230  $value = '2022-09-23 00:03:00';
231  $expected = BackendUtility::datetime((int)strtotime($value));
232  $languageServiceMock = $this->createMock(LanguageService::class);
233  $languageServiceMock->method('sL')->willReturn('testLabel');
234  ‪$GLOBALS['LANG'] = $languageServiceMock;
235  self::assertSame($expected, BackendUtility::getProcessedValue('tt_content', 'header', $value));
236  }
237 
238  #[Test]
240  {
241  ‪$GLOBALS['TCA'] = [
242  'tt_content' => [
243  'columns' => [
244  'header' => [
245  'config' => [
246  'type' => 'datetime',
247  'dbType' => 'datetime',
248  ],
249  ],
250  ],
251  ],
252  ];
253  $languageServiceMock = $this->createMock(LanguageService::class);
254  $languageServiceMock->method('sL')->willReturn('testLabel');
255  ‪$GLOBALS['LANG'] = $languageServiceMock;
256  self::assertSame('', BackendUtility::getProcessedValue('tt_content', 'header', null));
257  }
258 
259  #[Test]
261  {
262  ‪$GLOBALS['TCA'] = [
263  'tt_content' => [
264  'columns' => [
265  'header' => [
266  'config' => [
267  'type' => 'datetime',
268  'format' => 'date',
269  'dbType' => 'date',
270  'disableAgeDisplay' => true,
271  ],
272  ],
273  ],
274  ],
275  ];
276  $value = '2022-09-23';
277  $expected = BackendUtility::date((int)strtotime($value));
278  $languageServiceMock = $this->createMock(LanguageService::class);
279  $languageServiceMock->method('sL')->willReturn('testLabel');
280  ‪$GLOBALS['LANG'] = $languageServiceMock;
281  self::assertSame($expected, BackendUtility::getProcessedValue('tt_content', 'header', $value));
282  }
283 
284  #[Test]
285  public function ‪getProcessedValueForFlex(): void
286  {
287  ‪$GLOBALS['TCA'] = [
288  'tt_content' => [
289  'columns' => [
290  'pi_flexform' => [
291  'config' => [
292  'type' => 'flex',
293  ],
294  ],
295  ],
296  ],
297  ];
298  $languageServiceMock = $this->createMock(LanguageService::class);
299  $languageServiceMock->method('sL')->willReturn('testLabel');
300  ‪$GLOBALS['LANG'] = $languageServiceMock;
301  $expectation = "\n"
302  . "\n "
303  . "\n "
304  . "\n "
305  . "\n "
306  . "\n bar"
307  . "\n "
308  . "\n "
309  . "\n "
310  . "\n "
311  . "\n";
312 
313  self::assertSame($expectation, BackendUtility::getProcessedValue('tt_content', 'pi_flexform', '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
314 <T3FlexForms>
315  <data>
316  <sheet index="sDEF">
317  <language index="lDEF">
318  <field index="foo">
319  <value index="vDEF">bar</value>
320  </field>
321  </language>
322  </sheet>
323  </data>
324 </T3FlexForms>'));
325  }
326 
327  #[Test]
329  {
330  ‪$GLOBALS['TCA'] = [
331  'tt_content' => [
332  'columns' => [
333  'pages' => [
334  'config' => [
335  'type' => 'group',
336  'allowed' => 'pages',
337  'maxitems' => 22,
338  'size' => 3,
339  ],
340  ],
341  ],
342  ],
343  'pages' => [
344  'ctrl' => [
345  'label' => 'title',
346  ],
347  'columns' => [
348  'title' => [
349  'config' => [
350  'type' => 'input',
351  ],
352  ],
353  ],
354  ],
355  ];
356 
357  $languageServiceMock = $this->createMock(LanguageService::class);
358  $languageServiceMock->expects(self::any())->method('sL')->willReturnArgument(0);
359  ‪$GLOBALS['LANG'] = $languageServiceMock;
360 
361  $relationHandlerMock = $this->getMockBuilder(RelationHandler::class)->getMock();
362  $relationHandlerMock->expects(self::once())->method('start')->with('1,2');
363  $relationHandlerMock->expects(self::once())->method('getFromDB')->willReturn([]);
364  $relationHandlerMock->expects(self::once())->method('getResolvedItemArray')->willReturn([
365  [
366  'table' => 'pages',
367  'uid' => 1,
368  'record' => [
369  'uid' => 1,
370  'pid' => 0,
371  'title' => 'Page 1',
372  ],
373  ],
374  [
375  'table' => 'pages',
376  'uid' => 2,
377  'record' => [
378  'uid' => 2,
379  'pid' => 0,
380  'title' => 'Page 2',
381  ],
382  ],
383  ]);
384  GeneralUtility::addInstance(RelationHandler::class, $relationHandlerMock);
385 
386  self::assertSame('Page 1, Page 2', BackendUtility::getProcessedValue('tt_content', 'pages', '1,2'));
387  }
388 
389  #[Test]
391  {
392  ‪$GLOBALS['TCA'] = [
393  'index_config' => [
394  'ctrl' => [
395  'label' => 'title',
396  ],
397  'columns' => [
398  'title' => [
399  'config' => [
400  'type' => 'input',
401  ],
402  ],
403  'indexcfgs' => [
404  'config' => [
405  'type' => 'group',
406  'allowed' => 'index_config,pages',
407  'size' => 5,
408  ],
409  ],
410  ],
411  ],
412  'pages' => [
413  'ctrl' => [
414  'label' => 'title',
415  ],
416  'columns' => [
417  'title' => [
418  'config' => [
419  'type' => 'input',
420  ],
421  ],
422  ],
423  ],
424  ];
425 
426  $languageServiceMock = $this->createMock(LanguageService::class);
427  $languageServiceMock->method('sL')->willReturnArgument(0);
428  ‪$GLOBALS['LANG'] = $languageServiceMock;
429 
430  $relationHandlerMock = $this->getMockBuilder(RelationHandler::class)->getMock();
431  $relationHandlerMock->expects(self::once())->method('start')->with('pages_1,index_config_2');
432  $relationHandlerMock->expects(self::once())->method('getFromDB')->willReturn([]);
433  $relationHandlerMock->expects(self::once())->method('getResolvedItemArray')->willReturn([
434  [
435  'table' => 'pages',
436  'uid' => 1,
437  'record' => [
438  'uid' => 1,
439  'pid' => 0,
440  'title' => 'Page 1',
441  ],
442  ],
443  [
444  'table' => 'index_config',
445  'uid' => 2,
446  'record' => [
447  'uid' => 2,
448  'pid' => 0,
449  'title' => 'Configuration 2',
450  ],
451  ],
452  ]);
453  GeneralUtility::addInstance(RelationHandler::class, $relationHandlerMock);
454  self::assertSame('Page 1, Configuration 2', BackendUtility::getProcessedValue('index_config', 'indexcfgs', 'pages_1,index_config_2'));
455  }
456 
457  #[Test]
459  {
460  $relationHandlerMock = $this->getMockBuilder(RelationHandler::class)->getMock();
461  $relationHandlerMock->expects(self::once())->method('start')->with('2');
462  $relationHandlerMock->expects(self::once())->method('getFromDB')->willReturn([]);
463  $relationHandlerMock->expects(self::once())->method('getResolvedItemArray')->willReturn([
464  [
465  'table' => 'sys_category',
466  'uid' => 1,
467  'record' => [
468  'uid' => 2,
469  'pid' => 0,
470  'title' => 'Category 1',
471  ],
472  ],
473  [
474  'table' => 'sys_category',
475  'uid' => 2,
476  'record' => [
477  'uid' => 2,
478  'pid' => 0,
479  'title' => 'Category 2',
480  ],
481  ],
482  ]);
483 
484  $relationHandlerInstance = $relationHandlerMock;
485  $relationHandlerInstance->tableArray['sys_category'] = [1, 2];
486 
487  GeneralUtility::addInstance(RelationHandler::class, $relationHandlerInstance);
488 
489  ‪$GLOBALS['TCA'] = [
490  'pages' => [
491  'columns' => [
492  'categories' => [
493  'config' => [
494  'type' => 'select',
495  'foreign_table' => 'sys_category',
496  'MM' => 'sys_category_record_mm',
497  'MM_match_fields' => [
498  'fieldname' => 'categories',
499  'tablesnames' => 'pages',
500  ],
501  'MM_opposite_field' => 'items',
502  ],
503  ],
504  ],
505  ],
506  'sys_category' => [
507  'ctrl' => ['label' => 'title'],
508  'columns' => [
509  'title' => [
510  'config' => [
511  'type' => 'input',
512  ],
513  ],
514  'items' => [
515  'config' => [
516  'type' => 'group',
517  'allowed' => '*',
518  'MM' => 'sys_category_record_mm',
519  'MM_oppositeUsage' => [],
520  ],
521  ],
522  ],
523  ],
524  ];
525 
526  $languageServiceMock = $this->createMock(LanguageService::class);
527  $languageServiceMock->expects(self::any())->method('sL')->willReturnArgument(0);
528  ‪$GLOBALS['LANG'] = $languageServiceMock;
529 
530  self::assertSame(
531  'Category 1, Category 2',
532  BackendUtility::getProcessedValue(
533  'pages',
534  'categories',
535  '2',
536  0,
537  false,
538  false,
539  1
540  )
541  );
542  }
543 
544  #[Test]
546  {
547  $languageServiceMock = $this->createMock(LanguageService::class);
548  $languageServiceMock->method('sL')->willReturn(' min| hrs| days| yrs| min| hour| day| year');
549  ‪$GLOBALS['LANG'] = $languageServiceMock;
550 
551  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 8, 30, 2015);
552 
553  ‪$GLOBALS['TCA'] = [
554  'tt_content' => [
555  'columns' => [
556  'date' => [
557  'config' => [
558  'type' => 'datetime',
559  'format' => 'date',
560  ],
561  ],
562  ],
563  ],
564  ];
565  self::assertSame('28-08-15 (-2 days)', BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
566  }
567 
568  public static function ‪inputTypeDateDisplayOptions(): array
569  {
570  return [
571  'typeSafe Setting' => [
572  true,
573  '28-08-15',
574  ],
575  'non typesafe setting' => [
576  1,
577  '28-08-15',
578  ],
579  'setting disabled typesafe' => [
580  false,
581  '28-08-15 (-2 days)',
582  ],
583  'setting disabled not typesafe' => [
584  0,
585  '28-08-15 (-2 days)',
586  ],
587  ];
588  }
589 
593  #[DataProvider('inputTypeDateDisplayOptions')]
594  #[Test]
595  public function ‪getProcessedValueHandlesAgeDisplayCorrectly($input, string $expected): void
596  {
597  $languageServiceMock = $this->createMock(LanguageService::class);
598  $languageServiceMock->method('sL')->willReturn(' min| hrs| days| yrs| min| hour| day| year');
599 
600  ‪$GLOBALS['LANG'] = $languageServiceMock;
601 
602  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 8, 30, 2015);
603 
604  ‪$GLOBALS['TCA'] = [
605  'tt_content' => [
606  'columns' => [
607  'date' => [
608  'config' => [
609  'type' => 'datetime',
610  'format' => 'date',
611  'disableAgeDisplay' => $input,
612  ],
613  ],
614  ],
615  ],
616  ];
617  self::assertSame($expected, BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
618  }
619 
620  #[Test]
622  {
623  ‪$GLOBALS['TCA'] = [
624  'tt_content' => [
625  'columns' => [
626  'hide' => [
627  'config' => [
628  'type' => 'check',
629  'items' => [
630  [
631  0 => '',
632  ],
633  ],
634  ],
635  ],
636  ],
637  ],
638  ];
639  $languageServiceMock = $this->createMock(LanguageService::class);
640  $languageServiceMock->method('sL')->willReturnMap(
641  [
642  ['LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes', 'Yes'],
643  ['LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no', 'No'],
644  ]
645  );
646  ‪$GLOBALS['LANG'] = $languageServiceMock;
647  self::assertSame('Yes', BackendUtility::getProcessedValue('tt_content', 'hide', 1));
648  }
649 
650  #[Test]
652  {
653  ‪$GLOBALS['TCA'] = [
654  'tt_content' => [
655  'columns' => [
656  'hide' => [
657  'config' => [
658  'type' => 'check',
659  'items' => [
660  [
661  0 => '',
662  'invertStateDisplay' => true,
663  ],
664  ],
665  ],
666  ],
667  ],
668  ],
669  ];
670  $languageServiceMock = $this->createMock(LanguageService::class);
671  $languageServiceMock->method('sL')->willReturnMap(
672  [
673  ['LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes', 'Yes'],
674  ['LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no', 'No'],
675  ]
676  );
677  ‪$GLOBALS['LANG'] = $languageServiceMock;
678  self::assertSame('No', BackendUtility::getProcessedValue('tt_content', 'hide', 1));
679  }
680 
682  {
683  return [
684  'minimum fields' => [
685  'table' => 'test_table',
686  'prefix' => '',
687  'presetFields' => [],
688  'tca' => [],
689  'expectedFields' => 'uid,pid',
690  ],
691  'label set' => [
692  'table' => 'test_table',
693  'prefix' => '',
694  'presetFields' => [],
695  'tca' => [
696  'ctrl' => [
697  'label' => 'label',
698  ],
699  ],
700  'expectedFields' => 'uid,pid,label',
701  ],
702  'label_alt set' => [
703  'table' => 'test_table',
704  'prefix' => '',
705  'presetFields' => [],
706  'tca' => [
707  'ctrl' => [
708  'label_alt' => 'label,label2',
709  ],
710  ],
711  'expectedFields' => 'uid,pid,label,label2',
712  ],
713  'versioningWS set' => [
714  'table' => 'test_table',
715  'prefix' => '',
716  'presetFields' => [],
717  'tca' => [
718  'ctrl' => [
719  'versioningWS' => true,
720  ],
721  ],
722  'expectedFields' => 'uid,pid,t3ver_state,t3ver_wsid',
723  ],
724  'selicon_field set' => [
725  'table' => 'test_table',
726  'prefix' => '',
727  'presetFields' => [],
728  'tca' => [
729  'ctrl' => [
730  'selicon_field' => 'field',
731  ],
732  ],
733  'expectedFields' => 'uid,pid,field',
734  ],
735  'typeicon_column set' => [
736  'table' => 'test_table',
737  'prefix' => '',
738  'presetFields' => [],
739  'tca' => [
740  'ctrl' => [
741  'typeicon_column' => 'field',
742  ],
743  ],
744  'expectedFields' => 'uid,pid,field',
745  ],
746  'enablecolumns set' => [
747  'table' => 'test_table',
748  'prefix' => '',
749  'presetFields' => [],
750  'tca' => [
751  'ctrl' => [
752  'enablecolumns' => [
753  'disabled' => 'hidden',
754  'starttime' => 'start',
755  'endtime' => 'stop',
756  'fe_group' => 'groups',
757  ],
758  ],
759  ],
760  'expectedFields' => 'uid,pid,hidden,start,stop,groups',
761  ],
762  'label set to uid' => [
763  'table' => 'test_table',
764  'prefix' => '',
765  'presetFields' => [],
766  'tca' => [
767  'ctrl' => [
768  'label' => 'uid',
769  ],
770  ],
771  'expectedFields' => 'uid,pid',
772  ],
773  ];
774  }
775 
776  #[DataProvider('getCommonSelectFieldsReturnsCorrectFieldsDataProvider')]
777  #[Test]
779  string $table,
780  string $prefix,
781  array $presetFields,
782  array ‪$tca,
783  string $expectedFields = ''
784  ): void {
785  ‪$GLOBALS['TCA'][$table] = ‪$tca;
786  $selectFields = BackendUtility::getCommonSelectFields($table, $prefix, $presetFields);
787  self::assertEquals($selectFields, $expectedFields);
788  }
789 
791  {
792  return [
793  'item set' => [
794  'table' => 'tt_content',
795  'col' => 'menu_type',
796  'key' => '1',
797  'tca' => [
798  'columns' => [
799  'menu_type' => [
800  'config' => [
801  'items' => [
802  ['label' => 'Item 1', 'value' => '0'],
803  ['label' => 'Item 2', 'value' => '1'],
804  ['label' => 'Item 3', 'value' => '3'],
805  ],
806  ],
807  ],
808  ],
809  ],
810  'expectedLabel' => 'Item 2',
811  ],
812  'item set twice' => [
813  'table' => 'tt_content',
814  'col' => 'menu_type',
815  'key' => '1',
816  'tca' => [
817  'columns' => [
818  'menu_type' => [
819  'config' => [
820  'items' => [
821  ['label' => 'Item 1', 'value' => '0'],
822  ['label' => 'Item 2a', 'value' => '1'],
823  ['label' => 'Item 2b', 'value' => '1'],
824  ['label' => 'Item 3', 'value' => '3'],
825  ],
826  ],
827  ],
828  ],
829  ],
830  'expectedLabel' => 'Item 2a',
831  ],
832  'item not found' => [
833  'table' => 'tt_content',
834  'col' => 'menu_type',
835  'key' => '5',
836  'tca' => [
837  'columns' => [
838  'menu_type' => [
839  'config' => [
840  'items' => [
841  ['label' => 'Item 1', 'value' => '0'],
842  ['label' => 'Item 2', 'value' => '1'],
843  ['label' => 'Item 3', 'value' => '2'],
844  ],
845  ],
846  ],
847  ],
848  ],
849  'expectedLabel' => null,
850  ],
851  'item from itemsProcFunc' => [
852  'table' => 'tt_content',
853  'col' => 'menu_type',
854  'key' => '1',
855  'tca' => [
856  'columns' => [
857  'menu_type' => [
858  'config' => [
859  'type' => 'radio',
860  'items' => [],
861  'itemsProcFunc' => static function (array $parameters, $pObj) {
862  $parameters['items'] = [
863  ['label' => 'Item 1', 'value' => '0'],
864  ['label' => 'Item 2', 'value' => '1'],
865  ['label' => 'Item 3', 'value' => '2'],
866  ];
867  },
868  ],
869  ],
870  ],
871  ],
872  'expectedLabel' => 'Item 2',
873  ],
874  ];
875  }
876 
877  #[DataProvider('getLabelFromItemlistReturnsCorrectFieldsDataProvider')]
878  #[Test]
880  string $table,
881  string $col,
882  string $key,
883  array ‪$tca,
884  ?string $expectedLabel = ''
885  ): void {
886  ‪$GLOBALS['TCA'][$table] = ‪$tca;
887 
888  $cacheManagerMock = $this->createMock(CacheManager::class);
889  $cacheMock = $this->createMock(FrontendInterface::class);
890  $cacheManagerMock->method('getCache')->with('runtime')->willReturn($cacheMock);
891  $cacheMock->method('get')->willReturnMap([
892  ['pageTsConfig-pid-to-hash-0', 'hash'],
893  ['pageTsConfig-hash-to-object-hash', new ‪PageTsConfig(new ‪RootNode())],
894  ]);
895  $siteFinderMock = $this->createMock(SiteFinder::class);
896  GeneralUtility::addInstance(ItemProcessingService::class, new ‪ItemProcessingService($siteFinderMock));
897  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerMock);
898 
899  $label = BackendUtility::getLabelFromItemlist($table, $col, $key);
900  self::assertEquals($label, $expectedLabel);
901  GeneralUtility::purgeInstances();
902  }
903 
905  {
906  return [
907  'no field found' => [
908  'pageId' => 123,
909  'table' => 'tt_content',
910  'col' => 'menu_type',
911  'key' => '10',
912  'tca' => [
913  'columns' => [
914  'menu_type' => [
915  'config' => [
916  'items' => [
917  ['label' => 'Item 1', 'value' => '0'],
918  ['label' => 'Item 2', 'value' => '1'],
919  ['label' => 'Item 3', 'value' => '3'],
920  ],
921  ],
922  ],
923  ],
924  ],
925  'expectedLabel' => '',
926  ],
927  'no tsconfig set' => [
928  'pageId' => 123,
929  'table' => 'tt_content',
930  'col' => 'menu_type',
931  'key' => '1',
932  'tca' => [
933  'columns' => [
934  'menu_type' => [
935  'config' => [
936  'items' => [
937  ['label' => 'Item 1', 'value' => '0'],
938  ['label' => 'Item 2', 'value' => '1'],
939  ['label' => 'Item 3', 'value' => '3'],
940  ],
941  ],
942  ],
943  ],
944  ],
945  'expectedLabel' => 'Item 2',
946  ],
947  ];
948  }
949 
950  #[DataProvider('getLabelFromItemListMergedReturnsCorrectFieldsDataProvider')]
951  #[Test]
953  int $pageId,
954  string $table,
955  string $column,
956  string $key,
957  array ‪$tca,
958  string $expectedLabel = ''
959  ): void {
960  ‪$GLOBALS['TCA'][$table] = ‪$tca;
961 
962  self::assertEquals($expectedLabel, LabelFromItemListMergedReturnsCorrectFieldsFixture::getLabelFromItemListMerged($pageId, $table, $column, $key));
963  }
964 
965  public static function ‪getLabelsFromItemsListDataProvider(): array
966  {
967  return [
968  'return value if found' => [
969  'foobar', // table
970  'someColumn', // col
971  'foo, bar', // keyList
972  [ // TCA
973  'columns' => [
974  'someColumn' => [
975  'config' => [
976  'items' => [
977  ['label' => 'aFooLabel', 'value' => 'foo'],
978  ['label' => 'aBarLabel', 'value' => 'bar'],
979  ],
980  ],
981  ],
982  ],
983  ],
984  [], // page TSconfig
985  'aFooLabel, aBarLabel', // expected
986  ],
987  'page TSconfig overrules TCA' => [
988  'foobar', // table
989  'someColumn', // col
990  'foo,bar, add', // keyList
991  [ // TCA
992  'columns' => [
993  'someColumn' => [
994  'config' => [
995  'items' => [
996  ['label' => 'aFooLabel', 'value' => 'foo'],
997  ['label' => 'aBarLabel', 'value' => 'bar'],
998  ],
999  ],
1000  ],
1001  ],
1002  ],
1003  [ // page TSconfig
1004  'addItems.' => ['add' => 'aNewLabel'],
1005  'altLabels.' => ['bar' => 'aBarDiffLabel'],
1006  ],
1007  'aFooLabel, aBarDiffLabel, aNewLabel', // expected
1008  ],
1009  'itemsProcFunc is evaluated' => [
1010  'foobar', // table
1011  'someColumn', // col
1012  'foo,bar', // keyList
1013  [ // TCA
1014  'columns' => [
1015  'someColumn' => [
1016  'config' => [
1017  'type' => 'select',
1018  'itemsProcFunc' => static function (array $parameters, $pObj) {
1019  $parameters['items'] = [
1020  ['label' => 'aFooLabel', 'value' => 'foo'],
1021  ['label' => 'aBarLabel', 'value' => 'bar'],
1022  ];
1023  },
1024  ],
1025  ],
1026  ],
1027  ],
1028  [],
1029  'aFooLabel, aBarLabel', // expected
1030  ],
1031  ];
1032  }
1033 
1034  #[DataProvider('getLabelsFromItemsListDataProvider')]
1035  #[Test]
1037  string $table,
1038  string $col,
1039  string $keyList,
1040  array ‪$tca,
1041  array $pageTsConfig,
1042  string $expectedLabel
1043  ): void {
1044  // Stub LanguageService and let sL() return the same value that came in again
1045  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
1046  ‪$GLOBALS['LANG']->method('sL')->willReturnArgument(0);
1047 
1048  $cacheManagerMock = $this->createMock(CacheManager::class);
1049  $cacheMock = $this->createMock(FrontendInterface::class);
1050  $cacheManagerMock->method('getCache')->with('runtime')->willReturn($cacheMock);
1051  $cacheMock->method('get')->willReturnMap([
1052  ['pageTsConfig-pid-to-hash-0', 'hash'],
1053  ['pageTsConfig-hash-to-object-hash', new ‪PageTsConfig(new ‪RootNode())],
1054  ]);
1055  $siteFinderMock = $this->createMock(SiteFinder::class);
1056  GeneralUtility::addInstance(ItemProcessingService::class, new ‪ItemProcessingService($siteFinderMock));
1057  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerMock);
1058 
1059  ‪$GLOBALS['TCA'][$table] = ‪$tca;
1060  $label = BackendUtility::getLabelsFromItemsList($table, $col, $keyList, $pageTsConfig);
1061  self::assertEquals($expectedLabel, $label);
1062  GeneralUtility::purgeInstances();
1063  }
1064 
1065  #[Test]
1067  {
1068  $table = 'foobar';
1069  $col = 'someColumn';
1070  ‪$tca = [
1071  'columns' => [
1072  'someColumn' => [
1073  'config' => [
1074  'type' => 'select',
1075  'items' => [
1076  ['label' => 'aFooLabel', 'value' => 'foo'],
1077  ['label' => 'aBarLabel', 'value' => 'bar'],
1078  ],
1079  ],
1080  ],
1081  ],
1082  ];
1083  // Stub LanguageService and let sL() return the same value that came in again
1084  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
1085  ‪$GLOBALS['LANG']->method('sL')->willReturnArgument(0);
1086 
1087  ‪$GLOBALS['TCA'][$table] = ‪$tca;
1088  $label = BackendUtility::getProcessedValue($table, $col, 'foo,invalidKey,bar');
1089  self::assertEquals('aFooLabel, aBarLabel', $label);
1090  }
1091 
1092  #[Test]
1094  {
1095  $table = 'foobar';
1096  $col = 'someColumn';
1097  ‪$tca = [
1098  'columns' => [
1099  'someColumn' => [
1100  'config' => [
1101  'type' => 'select',
1102  'items' => [
1103  '0' => ['label' => 'aFooLabel', 'value' => 'foo'],
1104  ],
1105  ],
1106  ],
1107  ],
1108  ];
1109  // Stub LanguageService and let sL() return the same value that came in again
1110  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
1111  ‪$GLOBALS['LANG']->method('sL')->willReturnArgument(0);
1112 
1113  ‪$GLOBALS['TCA'][$table] = ‪$tca;
1114  $label = BackendUtility::getProcessedValue($table, $col, 'invalidKey');
1115  self::assertEquals('invalidKey', $label);
1116  }
1117 
1118  #[Test]
1119  public function ‪dateTimeAgeReturnsCorrectValues(): void
1120  {
1121  $languageServiceMock = $this->createMock(LanguageService::class);
1122  $languageServiceMock->method('sL')->willReturn(' min| hrs| days| yrs| min| hour| day| year');
1123  ‪$GLOBALS['LANG'] = $languageServiceMock;
1124  ‪$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 3, 23, 2016);
1125 
1126  self::assertSame('24-03-16 00:00 (-1 day)', BackendUtility::dateTimeAge(‪$GLOBALS['EXEC_TIME'] + 86400));
1127  self::assertSame('24-03-16 (-1 day)', BackendUtility::dateTimeAge(‪$GLOBALS['EXEC_TIME'] + 86400, 1, 'date'));
1128  }
1129 
1130  #[Test]
1132  {
1133  $propertyNames = [
1134  'uid',
1135  'pid',
1136  '_ORIG_PID',
1137  ];
1138  $computedPropertyNames = BackendUtility::purgeComputedPropertyNames($propertyNames);
1139  self::assertSame(['uid', 'pid'], $computedPropertyNames);
1140  }
1141 
1142  #[Test]
1144  {
1145  ‪$record = [
1146  'uid' => 1,
1147  'pid' => 2,
1148  '_ORIG_PID' => 1,
1149  ];
1150  $expected = [
1151  'uid' => 1,
1152  'pid' => 2,
1153  ];
1154  $computedProperties = BackendUtility::purgeComputedPropertiesFromRecord(‪$record);
1155  self::assertSame($expected, $computedProperties);
1156  }
1157 
1158  public static function ‪splitTableUidDataProvider(): array
1159  {
1160  return [
1161  'simple' => [
1162  'pages_23',
1163  ['pages', '23'],
1164  ],
1165  'complex' => [
1166  'tt_content_13',
1167  ['tt_content', '13'],
1168  ],
1169  'multiple underscores' => [
1170  'tx_runaway_domain_model_crime_scene_1234',
1171  ['tx_runaway_domain_model_crime_scene', '1234'],
1172  ],
1173  'no underscore' => [
1174  'foo',
1175  ['', 'foo'],
1176  ],
1177  ];
1178  }
1179 
1180  #[DataProvider('splitTableUidDataProvider')]
1181  #[Test]
1182  public function ‪splitTableUid($input, $expected): void
1183  {
1184  $result = BackendUtility::splitTable_Uid($input);
1185  self::assertSame($expected, $result);
1186  }
1187 
1188  #[Test]
1190  {
1191  $tableName = 'table_a';
1192  $fieldName = 'field_a';
1193  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = [];
1194  self::assertNull(BackendUtility::resolveFileReferences($tableName, $fieldName, []));
1195  }
1196 
1197  #[DataProvider('unfitResolveFileReferencesTableConfig')]
1198  #[Test]
1199  public function ‪returnNullForUnfitTableConfigInResolveFileReferences(array $config): void
1200  {
1201  $tableName = 'table_a';
1202  $fieldName = 'field_a';
1203  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = $config;
1204  self::assertNull(BackendUtility::resolveFileReferences($tableName, $fieldName, []));
1205  }
1206 
1207  public static function ‪unfitResolveFileReferencesTableConfig(): array
1208  {
1209  return [
1210  'invalid table' => [
1211  [
1212  'type' => 'inline',
1213  'foreign_table' => 'table_b',
1214  ],
1215  ],
1216  'empty table' => [
1217  [
1218  'type' => 'inline',
1219  'foreign_table' => '',
1220  ],
1221  ],
1222  'invalid type' => [
1223  [
1224  'type' => 'select',
1225  'foreign_table' => 'sys_file_reference',
1226  ],
1227  ],
1228  'empty type' => [
1229  [
1230  'type' => '',
1231  'foreign_table' => 'sys_file_reference',
1232  ],
1233  ],
1234  'empty' => [
1235  [
1236  'type' => '',
1237  'foreign_table' => '',
1238  ],
1239  ],
1240  ];
1241  }
1242 
1243  #[Test]
1245  {
1246  ‪$GLOBALS['BE_USER'] = null;
1247  $tableName = 'table_a';
1248  $row = [
1249  'uid' => 1,
1250  'pid' => 17,
1251  ];
1252  $reference = $row;
1253  BackendUtility::workspaceOL($tableName, $row);
1254  self::assertSame($reference, $row);
1255  }
1256 
1257  #[Test]
1259  {
1260  $tableName = 'table_a';
1261  $fieldName = 'field_a';
1262  $relationHandlerMock = $this->createMock(RelationHandler::class);
1263  $relationHandlerMock->expects(self::once())->method('start')->with(
1264  'foo',
1265  'sys_file_reference',
1266  '',
1267  42,
1268  $tableName,
1269  ['type' => 'file', 'foreign_table' => 'sys_file_reference']
1270  );
1271  $relationHandlerMock->expects(self::once())->method('processDeletePlaceholder');
1272  $relationHandlerMock->tableArray = ['sys_file_reference' => []];
1273  GeneralUtility::addInstance(RelationHandler::class, $relationHandlerMock);
1274  ‪$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'] = [
1275  'type' => 'file',
1276  'foreign_table' => 'sys_file_reference',
1277  ];
1278  $elementData = [
1279  $fieldName => 'foo',
1280  'uid' => 42,
1281  ];
1282 
1283  self::assertEmpty(BackendUtility::resolveFileReferences($tableName, $fieldName, $elementData));
1284  }
1285 
1286  #[Test]
1288  {
1289  ‪$GLOBALS['BE_USER'] = null;
1290  $tableName = 'table_a';
1291  ‪$uid = 42;
1292  self::assertSame(42, BackendUtility::wsMapId($tableName, ‪$uid));
1293  }
1294 
1295  #[Test]
1297  {
1298  ‪$GLOBALS['BE_USER'] = new ‪BackendUserAuthentication();
1299  self::assertEmpty(BackendUtility::getAllowedFieldsForTable('myTable', false));
1300  }
1301 
1302  #[Test]
1304  {
1305  ‪$GLOBALS['BE_USER'] = new ‪BackendUserAuthentication();
1306  ‪$GLOBALS['TCA']['myTable'] = [
1307  'ctrl' => [
1308  'tstamp' => 'updatedon',
1309  // Won't be added due to defined in "columns"
1310  'crdate' => 'createdon',
1311  'sortby' => 'sorting',
1312  'versioningWS' => true,
1313  ],
1314  'columns' => [
1315  // Regular field
1316  'title' => [
1317  'config' => [
1318  'type' => 'input',
1319  ],
1320  ],
1321  // Overwrite automatically set management field from "ctrl"
1322  'createdon' => [
1323  'config' => [
1324  'type' => 'input',
1325  ],
1326  ],
1327  // Won't be added due to type "none"
1328  'reference' => [
1329  'config' => [
1330  'type' => 'none',
1331  ],
1332  ],
1333  ],
1334  ];
1335 
1336  self::assertEquals(
1337  ['title', 'createdon', 'uid', 'pid', 'updatedon', 'sorting', 't3ver_state', 't3ver_wsid', 't3ver_oid'],
1338  BackendUtility::getAllowedFieldsForTable('myTable', false)
1339  );
1340  }
1341 }
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore
‪purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore()
Definition: BackendUtilityTest.php:1131
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemListMergedReturnsCorrectFields
‪getLabelFromItemListMergedReturnsCorrectFields(int $pageId, string $table, string $column, string $key, array $tca, string $expectedLabel='')
Definition: BackendUtilityTest.php:952
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForCheckWithSingleItem
‪getProcessedValueForCheckWithSingleItem()
Definition: BackendUtilityTest.php:621
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: BackendUtilityTest.php:38
‪TYPO3\CMS\Core\Database\RelationHandler
Definition: RelationHandler.php:36
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemlistReturnsCorrectFields
‪getLabelFromItemlistReturnsCorrectFields(string $table, string $col, string $key, array $tca, ?string $expectedLabel='')
Definition: BackendUtilityTest.php:879
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroup
‪getProcessedValueForGroup()
Definition: BackendUtilityTest.php:154
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroupWithOneAllowedTable
‪getProcessedValueForGroupWithOneAllowedTable()
Definition: BackendUtilityTest.php:328
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getCommonSelectFieldsReturnsCorrectFields
‪getCommonSelectFieldsReturnsCorrectFields(string $table, string $prefix, array $presetFields, array $tca, string $expectedFields='')
Definition: BackendUtilityTest.php:778
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForDatetimeDbTypeDateNull
‪getProcessedValueForDatetimeDbTypeDateNull()
Definition: BackendUtilityTest.php:194
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForZeroStringIsZero
‪getProcessedValueForZeroStringIsZero()
Definition: BackendUtilityTest.php:134
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelsFromItemsListReturnsCorrectValue
‪getLabelsFromItemsListReturnsCorrectValue(string $table, string $col, string $keyList, array $tca, array $pageTsConfig, string $expectedLabel)
Definition: BackendUtilityTest.php:1036
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForSelectWithMMRelation
‪getProcessedValueForSelectWithMMRelation()
Definition: BackendUtilityTest.php:458
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemListMergedReturnsCorrectFieldsDataProvider
‪static getLabelFromItemListMergedReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:904
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForGroupWithMultipleAllowedTables
‪getProcessedValueForGroupWithMultipleAllowedTables()
Definition: BackendUtilityTest.php:390
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\dateTimeAgeReturnsCorrectValues
‪dateTimeAgeReturnsCorrectValues()
Definition: BackendUtilityTest.php:1119
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForCheckWithSingleItemInvertStateDisplay
‪getProcessedValueForCheckWithSingleItemInvertStateDisplay()
Definition: BackendUtilityTest.php:651
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\unfitResolveFileReferencesTableConfig
‪static unfitResolveFileReferencesTableConfig()
Definition: BackendUtilityTest.php:1207
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getAllowedFieldsForTableReturnsUniqueList
‪getAllowedFieldsForTableReturnsUniqueList()
Definition: BackendUtilityTest.php:1303
‪TYPO3\CMS\Backend\Tests\Unit\Utility
Definition: BackendUtilityTest.php:18
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getCommonSelectFieldsReturnsCorrectFieldsDataProvider
‪static getCommonSelectFieldsReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:681
‪TYPO3\CMS\Core\TypoScript\PageTsConfig
Definition: PageTsConfig.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForFlex
‪getProcessedValueForFlex()
Definition: BackendUtilityTest.php:285
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForDatetimeDbTypeDatetimeNull
‪getProcessedValueForDatetimeDbTypeDatetimeNull()
Definition: BackendUtilityTest.php:239
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\returnNullForUnfitTableConfigInResolveFileReferences
‪returnNullForUnfitTableConfigInResolveFileReferences(array $config)
Definition: BackendUtilityTest.php:1199
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueHandlesAgeDisplayCorrectly
‪getProcessedValueHandlesAgeDisplayCorrectly($input, string $expected)
Definition: BackendUtilityTest.php:595
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\wsMapIdReturnsLiveIdIfNoBeUserIsAvailable
‪wsMapIdReturnsLiveIdIfNoBeUserIsAvailable()
Definition: BackendUtilityTest.php:1287
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueReturnsPlainValueIfItemIsNotFound
‪getProcessedValueReturnsPlainValueIfItemIsNotFound()
Definition: BackendUtilityTest.php:1093
‪TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures\LabelFromItemListMergedReturnsCorrectFieldsFixture
Definition: LabelFromItemListMergedReturnsCorrectFieldsFixture.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getAllowedFieldsForTableReturnsEmptyArrayOnBrokenTca
‪getAllowedFieldsForTableReturnsEmptyArrayOnBrokenTca()
Definition: BackendUtilityTest.php:1296
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent
‪getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent()
Definition: BackendUtilityTest.php:545
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\inputTypeDateDisplayOptions
‪static inputTypeDateDisplayOptions()
Definition: BackendUtilityTest.php:568
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\calcAgeReturnsExpectedValues
‪calcAgeReturnsExpectedValues(int $seconds, string $expectedLabel)
Definition: BackendUtilityTest.php:122
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:61
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable
‪resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable()
Definition: BackendUtilityTest.php:1258
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForDatetimeDbTypeDate
‪getProcessedValueForDatetimeDbTypeDate()
Definition: BackendUtilityTest.php:260
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:22
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\calcAgeDataProvider
‪static calcAgeDataProvider()
Definition: BackendUtilityTest.php:46
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\splitTableUid
‪splitTableUid($input, $expected)
Definition: BackendUtilityTest.php:1182
‪TYPO3\CMS\Core\DataHandling\ItemProcessingService
Definition: ItemProcessingService.php:34
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelsFromItemsListDataProvider
‪static getLabelsFromItemsListDataProvider()
Definition: BackendUtilityTest.php:965
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForDatetimeDbTypeDatetime
‪getProcessedValueForDatetimeDbTypeDatetime()
Definition: BackendUtilityTest.php:216
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\TypoScript\AST\Node\RootNode
Definition: RootNode.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\workspaceOLDoesNotChangeValuesForNoBeUserAvailable
‪workspaceOLDoesNotChangeValuesForNoBeUserAvailable()
Definition: BackendUtilityTest.php:1244
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore
‪purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore()
Definition: BackendUtilityTest.php:1143
‪$tca
‪$tca
Definition: sys_file_metadata.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\returnNullForMissingTcaConfigInResolveFileReferences
‪returnNullForMissingTcaConfigInResolveFileReferences()
Definition: BackendUtilityTest.php:1189
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest
Definition: BackendUtilityTest.php:37
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueReturnsLabelsForExistingValuesSolely
‪getProcessedValueReturnsLabelsForExistingValuesSolely()
Definition: BackendUtilityTest.php:1066
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getLabelFromItemlistReturnsCorrectFieldsDataProvider
‪static getLabelFromItemlistReturnsCorrectFieldsDataProvider()
Definition: BackendUtilityTest.php:790
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\splitTableUidDataProvider
‪static splitTableUidDataProvider()
Definition: BackendUtilityTest.php:1158
‪TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForFlexNull
‪getProcessedValueForFlexNull()
Definition: BackendUtilityTest.php:174