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