‪TYPO3CMS  11.5
DataHandlerTest.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 Prophecy\Argument;
30 use ‪TYPO3\CMS\Core\SysLog\Error as SystemLogErrorClassification;
36 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
37 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
38 
42 class ‪DataHandlerTest extends UnitTestCase
43 {
44  use \Prophecy\PhpUnit\ProphecyTrait;
48  protected ‪$resetSingletonInstances = true;
49 
53  protected array ‪$singletonInstances = [];
54 
58  protected ‪$subject;
59 
63  protected ‪$backEndUser;
64 
68  protected function ‪setUp(): void
69  {
70  parent::setUp();
71  ‪$GLOBALS['TCA'] = [];
72  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
73  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
74  $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
75  $cacheManagerProphecy->getCache('runtime')->willReturn($cacheFrontendProphecy->reveal());
76  $this->backEndUser = $this->createMock(BackendUserAuthentication::class);
77  $this->subject = $this->getAccessibleMock(DataHandler::class, ['dummy']);
78  $this->subject->start([], [], $this->backEndUser);
79  }
80 
84  public function ‪fixtureCanBeCreated(): void
85  {
86  self::assertInstanceOf(DataHandler::class, $this->subject);
87  }
88 
90  // Test concerning checkModifyAccessList
92 
95  public function ‪adminIsAllowedToModifyNonAdminTable(): void
96  {
97  $this->subject->admin = true;
98  self::assertTrue($this->subject->checkModifyAccessList('tt_content'));
99  }
100 
104  public function ‪nonAdminIsNorAllowedToModifyNonAdminTable(): void
105  {
106  $this->subject->admin = false;
107  self::assertFalse($this->subject->checkModifyAccessList('tt_content'));
108  }
109 
114  {
115  $this->subject->admin = false;
116  $this->backEndUser->groupData['tables_modify'] = 'tt_content';
117  self::assertTrue($this->subject->checkModifyAccessList('tt_content'));
118  }
119 
123  public function ‪adminIsAllowedToModifyAdminTable(): void
124  {
125  $this->subject->admin = true;
126  self::assertTrue($this->subject->checkModifyAccessList('be_users'));
127  }
128 
132  public function ‪nonAdminIsNotAllowedToModifyAdminTable(): void
133  {
134  $this->subject->admin = false;
135  self::assertFalse($this->subject->checkModifyAccessList('be_users'));
136  }
137 
142  {
143  $tableName = ‪StringUtility::getUniqueId('aTable');
144  ‪$GLOBALS['TCA'] = [
145  $tableName => [
146  'ctrl' => [
147  'adminOnly' => true,
148  ],
149  ],
150  ];
151  $this->subject->admin = false;
152  $this->backEndUser->groupData['tables_modify'] = $tableName;
153  self::assertFalse($this->subject->checkModifyAccessList($tableName));
154  }
155 
159  public function ‪checkValueInputEvalWithEvalDouble2(): void
160  {
161  $testData = [
162  '-0,5' => '-0.50',
163  '1000' => '1000.00',
164  '1000,10' => '1000.10',
165  '1000,0' => '1000.00',
166  '600.000.000,00' => '600000000.00',
167  '60aaa00' => '6000.00',
168  ];
169  foreach ($testData as $value => $expectedReturnValue) {
170  $returnValue = $this->subject->checkValue_input_Eval($value, ['double2'], '');
171  self::assertSame($expectedReturnValue, $returnValue['value']);
172  }
173  }
174 
179  {
180  // Three elements: input, timezone of input, expected output (UTC)
181  return [
182  'timestamp is passed through, as it is UTC' => [
183  1457103519, 'Europe/Berlin', 1457103519,
184  ],
185  'ISO date is interpreted as local date and is output as correct timestamp' => [
186  '2017-06-07T00:10:00Z', 'Europe/Berlin', 1496787000,
187  ],
188  ];
189  }
190 
195  public function ‪checkValueInputEvalWithEvalDatetime($input, $serverTimezone, $expectedOutput): void
196  {
197  $oldTimezone = date_default_timezone_get();
198  date_default_timezone_set($serverTimezone);
199 
200  ‪$output = $this->subject->checkValue_input_Eval($input, ['datetime'], '');
201 
202  // set before the assertion is performed, so it is restored even for failing tests
203  date_default_timezone_set($oldTimezone);
204 
205  self::assertEquals($expectedOutput, ‪$output['value']);
206  }
207 
212  {
213  // Note the involved salted passwords are NOT mocked since the factory is static
214  ‪$subject = new ‪DataHandler();
215  $inputValue = '$1$GNu9HdMt$RwkPb28pce4nXZfnplVZY/';
216  $result = ‪$subject->‪checkValue_input_Eval($inputValue, ['saltedPassword'], '', 'be_users');
217  self::assertSame($inputValue, $result['value']);
218  }
219 
224  {
225  // Note the involved salted passwords are NOT mocked since the factory is static
226  $inputValue = 'myPassword';
227  ‪$subject = new ‪DataHandler();
228  $result = ‪$subject->‪checkValue_input_Eval($inputValue, ['saltedPassword'], '', 'be_users');
229  self::assertNotSame($inputValue, $result['value']);
230  }
231 
237  public function ‪inputValuesStringsDataProvider(): array
238  {
239  return [
240  'Empty string returns zero as integer' => [
241  '',
242  0,
243  ],
244  '"0" returns zero as integer' => [
245  '0',
246  0,
247  ],
248  '"-2000001" is interpreted correctly as -2000001 but is lower than -2000000 and set to -2000000' => [
249  '-2000001',
250  -2000000,
251  ],
252  '"-2000000" is interpreted correctly as -2000000 and is equal to -2000000' => [
253  '-2000000',
254  -2000000,
255  ],
256  '"2000000" is interpreted correctly as 2000000 and is equal to 2000000' => [
257  '2000000',
258  2000000,
259  ],
260  '"2000001" is interpreted correctly as 2000001 but is greater then 2000000 and set to 2000000' => [
261  '2000001',
262  2000000,
263  ],
264  ];
265  }
266 
273  public function ‪inputValueCheckRecognizesStringValuesAsIntegerValuesCorrectly(string $value, int $expectedReturnValue): void
274  {
275  $tcaFieldConf = [
276  'type' => 'input',
277  'eval' => 'int',
278  'range' => [
279  'lower' => '-2000000',
280  'upper' => '2000000',
281  ],
282  ];
283  $returnValue = $this->subject->_call('checkValueForInput', $value, $tcaFieldConf, '', 0, 0, '');
284  self::assertSame($expectedReturnValue, $returnValue['value']);
285  }
286 
292  public function ‪inputValuesRangeDoubleDataProvider(): array
293  {
294  return [
295  'Empty string returns zero as string' => [
296  '',
297  '0.00',
298  ],
299  '"0" returns zero as string' => [
300  '0',
301  '0.00',
302  ],
303  '"-0.5" is interpreted correctly as -0.5 but is lower than 0 and set to 0' => [
304  '-0.5',
305  0,
306  ],
307  '"0.5" is interpreted correctly as 0.5 and is equal to 0.5' => [
308  '0.5',
309  '0.50',
310  ],
311  '"39.9" is interpreted correctly as 39.9 and is equal to 39.9' => [
312  '39.9',
313  '39.90',
314  ],
315  '"42.3" is interpreted correctly as 42.3 but is greater then 42 and set to 42' => [
316  '42.3',
317  42,
318  ],
319  ];
320  }
321 
328  public function ‪inputValueCheckRespectsRightLowerAndUpperLimitForDouble($value, $expectedReturnValue): void
329  {
330  $tcaFieldConf = [
331  'type' => 'input',
332  'eval' => 'double2',
333  'range' => [
334  'lower' => '0',
335  'upper' => '42',
336  ],
337  ];
338  $returnValue = $this->subject->_call('checkValueForInput', $value, $tcaFieldConf, '', 0, 0, '');
339  self::assertSame($expectedReturnValue, $returnValue['value']);
340  }
341 
348  public function ‪inputValueCheckRespectsRightLowerAndUpperLimitWithDefaultValueForDouble($value, $expectedReturnValue): void
349  {
350  $tcaFieldConf = [
351  'type' => 'input',
352  'eval' => 'double2',
353  'range' => [
354  'lower' => '0',
355  'upper' => '42',
356  ],
357  'default' => 0,
358  ];
359  $returnValue = $this->subject->_call('checkValueForInput', $value, $tcaFieldConf, '', 0, 0, '');
360  self::assertSame($expectedReturnValue, $returnValue['value']);
361  }
362 
366  public function ‪inputValuesDataTimeDataProvider(): array
367  {
368  return [
369  'undershot date adjusted' => [
370  '2018-02-28T00:00:00Z',
371  1519862400,
372  ],
373  'exact lower date accepted' => [
374  '2018-03-01T00:00:00Z',
375  1519862400,
376  ],
377  'exact upper date accepted' => [
378  '2018-03-31T23:59:59Z',
379  1522540799,
380  ],
381  'exceeded date adjusted' => [
382  '2018-04-01T00:00:00Z',
383  1522540799,
384  ],
385  ];
386  }
387 
395  public function ‪inputValueCheckRecognizesDateTimeValuesAsIntegerValuesCorrectly(string $value, int $expected): void
396  {
397  $tcaFieldConf = [
398  'type' => 'input',
399  'eval' => 'datetime',
400  'range' => [
401  // unix timestamp: 1519862400
402  'lower' => gmmktime(0, 0, 0, 3, 1, 2018),
403  // unix timestamp: 1522540799
404  'upper' => gmmktime(23, 59, 59, 3, 31, 2018),
405  ],
406  ];
407 
408  // @todo Switch to UTC since otherwise DataHandler removes timezone offset
409  $previousTimezone = date_default_timezone_get();
410  date_default_timezone_set('UTC');
411 
412  $returnValue = $this->subject->_call('checkValueForInput', $value, $tcaFieldConf, '', 0, 0, '');
413 
414  date_default_timezone_set($previousTimezone);
415 
416  self::assertSame($expected, $returnValue['value']);
417  }
418 
420  {
421  return [
422  'Empty string returns empty string or the number zero' => [
423  '',
424  '',
425  0,
426  ],
427  'Zero returns zero as a string or the number zero' => [
428  0,
429  '0',
430  0,
431  ],
432  'Zero as a string returns zero as a string or the number zero' => [
433  '0',
434  '0',
435  0,
436  ],
437  ];
438  }
439 
447  public function ‪inputValueRangeCheckIsIgnoredWhenDefaultIsZeroAndInputValueIsEmpty($inputValue, string $expected, int $expectedEvalInt): void
448  {
449  $tcaFieldConf = [
450  'type' => 'input',
451  'eval' => 'datetime',
452  'default' => 0,
453  'range' => [
454  'lower' => 1627077600,
455  ],
456  ];
457 
458  $tcaFieldConfEvalInt = [
459  'type' => 'input',
460  'eval' => 'datetime,int',
461  'default' => '0',
462  'range' => [
463  'lower' => 1627077600,
464  ],
465  ];
466 
467  $returnValue = $this->subject->_call('checkValueForInput', $inputValue, $tcaFieldConf, '', 0, 0, '');
468  self::assertSame($expected, $returnValue['value']);
469 
470  $returnValue = $this->subject->_call('checkValueForInput', $inputValue, $tcaFieldConfEvalInt, '', 0, 0, '');
471  self::assertSame($expectedEvalInt, $returnValue['value']);
472  }
473 
478  {
479  return [
480  'tca without dbType' => [
481  [
482  'type' => 'input',
483  ],
484  ],
485  'tca with dbType != date/datetime/time' => [
486  [
487  'type' => 'input',
488  'dbType' => 'foo',
489  ],
490  ],
491  ];
492  }
493 
499  public function ‪inputValueCheckDoesNotCallGetDateTimeFormatsForNonDatetimeFields(array $tcaFieldConf): void
500  {
501  $this->subject->_call('checkValueForInput', '', $tcaFieldConf, '', 0, 0, '');
502  }
503 
508  {
509  return [
510  // Values of this kind are passed in from the inputDateTime control
511  'time from inputDateTime' => [
512  '1970-01-01T18:54:00Z',
513  'time',
514  '18:54:00',
515  ],
516  'date from inputDateTime' => [
517  '2020-11-25T00:00:00Z',
518  'date',
519  '2020-11-25',
520  ],
521  'datetime from inputDateTime' => [
522  '2020-11-25T18:54:00Z',
523  'datetime',
524  '2020-11-25 18:54:00',
525  ],
526  // Values of this kind are passed in when a data record is copied
527  'time from copying a record' => [
528  '18:54:00',
529  'time',
530  '18:54:00',
531  ],
532  'date from copying a record' => [
533  '2020-11-25',
534  'date',
535  '2020-11-25',
536  ],
537  'datetime from copying a record' => [
538  '2020-11-25 18:54:00',
539  'datetime',
540  '2020-11-25 18:54:00',
541  ],
542  ];
543  }
544 
550  public function ‪inputValueCheckDbtypeIsIndependentFromTimezone(string $value, string $dbtype, string $expectedOutput): void
551  {
552  $tcaFieldConf = [
553  'type' => 'input',
554  'dbType' => $dbtype,
555  ];
556 
557  $oldTimezone = date_default_timezone_get();
558  date_default_timezone_set('Europe/Berlin');
559 
560  $returnValue = $this->subject->_call('checkValueForInput', $value, $tcaFieldConf, '', 0, 0, '');
561 
562  // set before the assertion is performed, so it is restored even for failing tests
563  date_default_timezone_set($oldTimezone);
564 
565  self::assertEquals($expectedOutput, $returnValue['value']);
566  }
567 
569  // Tests concerning checkModifyAccessList
571  //
577  {
578  $this->expectException(\UnexpectedValueException::class);
579  $this->expectExceptionCode(1251892472);
580 
581  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'][] = InvalidHookFixture::class;
582  $this->subject->checkModifyAccessList('tt_content');
583  }
584 
590  public function ‪doesCheckModifyAccessListHookGetsCalled(): void
591  {
592  $hookClass = ‪StringUtility::getUniqueId('tx_coretest');
593  $hookMock = $this->getMockBuilder(DataHandlerCheckModifyAccessListHookInterface::class)
594  ->onlyMethods(['checkModifyAccessList'])
595  ->setMockClassName($hookClass)
596  ->getMock();
597  $hookMock->expects(self::once())->method('checkModifyAccessList');
598  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'][] = $hookClass;
599  GeneralUtility::addInstance($hookClass, $hookMock);
600  $this->subject->checkModifyAccessList('tt_content');
601  }
602 
609  {
610  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'][] = AllowAccessHookFixture::class;
611  self::assertTrue($this->subject->checkModifyAccessList('tt_content'));
612  }
613 
615  // Tests concerning process_datamap
617 
621  {
622  ‪$subject = $this->getMockBuilder(DataHandler::class)
623  ->onlyMethods(['log'])
624  ->getMock();
625  $this->backEndUser->workspace = 1;
626  $this->backEndUser->workspaceRec = ['freeze' => true];
628  self::assertFalse(‪$subject->‪process_datamap());
629  }
630 
634  public function ‪doesCheckFlexFormValueHookGetsCalled(): void
635  {
636  $hookClass = \stdClass::class;
637  $hookMock = $this->getMockBuilder($hookClass)
638  ->addMethods(['checkFlexFormValue_beforeMerge'])
639  ->getMock();
640  $hookMock->expects(self::once())->method('checkFlexFormValue_beforeMerge');
641  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'][] = $hookClass;
642  GeneralUtility::addInstance($hookClass, $hookMock);
643  $flexFormToolsProphecy = $this->prophesize(FlexFormTools::class);
644  $flexFormToolsProphecy->getDataStructureIdentifier(Argument::cetera())->willReturn('anIdentifier');
645  $flexFormToolsProphecy->parseDataStructureByIdentifier('anIdentifier')->willReturn([]);
646  GeneralUtility::addInstance(FlexFormTools::class, $flexFormToolsProphecy->reveal());
647  $this->subject->_call('checkValueForFlex', [], [], [], '', 0, '', '', 0, 0, 0, '');
648  }
649 
650  public function ‪checkValue_flex_procInData_travDSDataProvider(): iterable
651  {
652  yield 'Flat structure with TCEForms' => [
653  'dataValues' => [
654  'field1' => [
655  'vDEF' => 'wrong input',
656  ],
657  ],
658  'DSelements' => [
659  'field1' => [
660  'TCEforms' => [
661  'label' => 'A field',
662  'config' => [
663  'type' => 'input',
664  'eval' => 'required,int',
665  ],
666  ],
667  ],
668  ],
669  'expected' => [
670  'field1' => [
671  'vDEF' => 0,
672  ],
673  ],
674  ];
675 
676  yield 'Flat structure without TCEForms' => [
677  'dataValues' => [
678  'field1' => [
679  'vDEF' => 'wrong input',
680  ],
681  ],
682  'DSelements' => [
683  'field1' => [
684  'label' => 'A field',
685  'config' => [
686  'type' => 'input',
687  'eval' => 'required,int',
688  ],
689  ],
690  ],
691  'expected' => [
692  'field1' => [
693  'vDEF' => 0,
694  ],
695  ],
696  ];
697 
698  yield 'Array structure with TCEforms key' => [
699  'dataValues' => [
700  'section' => [
701  'el' => [
702  '1' => [
703  'container1' => [
704  'el' => [
705  'field1' => [
706  'vDEF' => 'wrong input',
707  ],
708  ],
709  ],
710  ],
711  ],
712  ],
713  ],
714  'DSelements' => [
715  'section' => [
716  'type' => 'array',
717  'section' => true,
718  'el' => [
719  'container1' => [
720  'type' => 'array',
721  'el' => [
722  'field1' => [
723  'TCEforms' => [
724  'label' => 'A field',
725  'config' => [
726  'type' => 'input',
727  'eval' => 'required,int',
728  ],
729  ],
730  ],
731  ],
732  ],
733  ],
734  ],
735  ],
736  'expected' => [
737  'section' => [
738  'el' => [
739  '1' => [
740  'container1' => [
741  'el' => [
742  'field1' => [
743  'vDEF' => 0,
744  ],
745  ],
746  ],
747  ],
748  ],
749  ],
750  ],
751  ];
752 
753  yield 'Array structure without TCEforms key' => [
754  'dataValues' => [
755  'section' => [
756  'el' => [
757  '1' => [
758  'container_1' => [
759  'el' => [
760  'field1' => [
761  'vDEF' => 'wrong input',
762  ],
763  ],
764  ],
765  ],
766  ],
767  ],
768  ],
769  'DSelements' => [
770  'section' => [
771  'type' => 'array',
772  'section' => true,
773  'el' => [
774  'container_1' => [
775  'type' => 'array',
776  'el' => [
777  'field1' => [
778  'label' => 'A field',
779  'config' => [
780  'type' => 'input',
781  'eval' => 'required,int',
782  ],
783  ],
784  ],
785  ],
786  ],
787  ],
788  ],
789  'expected' => [
790  'section' => [
791  'el' => [
792  '1' => [
793  'container_1' => [
794  'el' => [
795  'field1' => [
796  'vDEF' => 0,
797  ],
798  ],
799  ],
800  ],
801  ],
802  ],
803  ],
804  ];
805  }
806 
814  public function ‪checkValue_flex_procInData_travDS(array $dataValues, array $DSelements, array $expected): void
815  {
816  $pParams = [
817  'tt_content',
818  777,
819  '<?xml ... ?>',
820  'update',
821  1,
822  'tt_content:777:pi_flexform',
823  0,
824  ];
825 
826  $languageServiceProphecy = $this->prophesize(LanguageService::class);
827  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
828  $this->subject->checkValue_flex_procInData_travDS($dataValues, [], $DSelements, $pParams, '', '');
829  self::assertSame($expected, $dataValues);
830  }
831 
833  // Tests concerning log
835 
839  {
840  $backendUser = $this->createMock(BackendUserAuthentication::class);
841  $backendUser->expects(self::once())->method('writelog');
842  $this->subject->enableLogging = true;
843  $this->subject->BE_USER = $backendUser;
844  $this->subject->log('', 23, SystemLogGenericAction::UNDEFINED, 42, SystemLogErrorClassification::MESSAGE, 'details');
845  }
846 
851  {
852  $backendUser = $this->createMock(BackendUserAuthentication::class);
853  $backendUser->expects(self::never())->method('writelog');
854  $this->subject->enableLogging = false;
855  $this->subject->BE_USER = $backendUser;
856  $this->subject->log('', 23, SystemLogGenericAction::UNDEFINED, 42, SystemLogErrorClassification::MESSAGE, 'details');
857  }
858 
862  public function ‪logAddsEntryToLocalErrorLogArray(): void
863  {
864  $backendUser = $this->createMock(BackendUserAuthentication::class);
865  $this->subject->BE_USER = $backendUser;
866  $this->subject->enableLogging = true;
867  $this->subject->errorLog = [];
868  $logDetailsUnique = ‪StringUtility::getUniqueId('details');
869  $this->subject->log('', 23, SystemLogGenericAction::UNDEFINED, 42, SystemLogErrorClassification::USER_ERROR, $logDetailsUnique);
870  self::assertArrayHasKey(0, $this->subject->errorLog);
871  self::assertStringEndsWith($logDetailsUnique, $this->subject->errorLog[0]);
872  }
873 
878  {
879  $backendUser = $this->createMock(BackendUserAuthentication::class);
880  $this->subject->BE_USER = $backendUser;
881  $this->subject->enableLogging = true;
882  $this->subject->errorLog = [];
883  $logDetails = ‪StringUtility::getUniqueId('details');
884  $this->subject->log('', 23, SystemLogGenericAction::UNDEFINED, 42, SystemLogErrorClassification::USER_ERROR, '%1$s' . $logDetails . '%2$s', -1, ['foo', 'bar']);
885  $expected = 'foo' . $logDetails . 'bar';
886  self::assertStringEndsWith($expected, $this->subject->errorLog[0]);
887  }
888 
892  public function ‪logFormatsDetailMessageWithPlaceholders(): void
893  {
894  $backendUser = $this->createMock(BackendUserAuthentication::class);
895  $this->subject->BE_USER = $backendUser;
896  $this->subject->enableLogging = true;
897  $this->subject->errorLog = [];
898  $logDetails = 'An error occurred on {table}:{uid} when localizing';
899  $this->subject->log('', 23, SystemLogGenericAction::UNDEFINED, 42, SystemLogErrorClassification::USER_ERROR, $logDetails, -1, ['table' => 'tx_sometable', 0 => 'some random value']);
900  // UID is kept as non-replaced, and other properties are not replaced.
901  $expected = 'An error occurred on tx_sometable:{uid} when localizing';
902  self::assertStringEndsWith($expected, $this->subject->errorLog[0]);
903  }
904 
915  public function ‪equalSubmittedAndStoredValuesAreDetermined($expected, $submittedValue, $storedValue, $storedType, $allowNull): void
916  {
917  $result = \Closure::bind(function () use ($submittedValue, $storedValue, $storedType, $allowNull) {
918  return $this->isSubmittedValueEqualToStoredValue($submittedValue, $storedValue, $storedType, $allowNull);
919  }, ‪$this->subject, DataHandler::class)();
920  self::assertEquals($expected, $result);
921  }
922 
927  {
928  return [
929  // String
930  'string value "" vs. ""' => [
931  true,
932  '', '', 'string', false,
933  ],
934  'string value 0 vs. "0"' => [
935  true,
936  0, '0', 'string', false,
937  ],
938  'string value 1 vs. "1"' => [
939  true,
940  1, '1', 'string', false,
941  ],
942  'string value "0" vs. ""' => [
943  false,
944  '0', '', 'string', false,
945  ],
946  'string value 0 vs. ""' => [
947  false,
948  0, '', 'string', false,
949  ],
950  'string value null vs. ""' => [
951  true,
952  null, '', 'string', false,
953  ],
954  // Integer
955  'integer value 0 vs. 0' => [
956  true,
957  0, 0, 'int', false,
958  ],
959  'integer value "0" vs. "0"' => [
960  true,
961  '0', '0', 'int', false,
962  ],
963  'integer value 0 vs. "0"' => [
964  true,
965  0, '0', 'int', false,
966  ],
967  'integer value "" vs. "0"' => [
968  true,
969  '', '0', 'int', false,
970  ],
971  'integer value "" vs. 0' => [
972  true,
973  '', 0, 'int', false,
974  ],
975  'integer value "0" vs. 0' => [
976  true,
977  '0', 0, 'int', false,
978  ],
979  'integer value 1 vs. 1' => [
980  true,
981  1, 1, 'int', false,
982  ],
983  'integer value 1 vs. "1"' => [
984  true,
985  1, '1', 'int', false,
986  ],
987  'integer value "1" vs. "1"' => [
988  true,
989  '1', '1', 'int', false,
990  ],
991  'integer value "1" vs. 1' => [
992  true,
993  '1', 1, 'int', false,
994  ],
995  'integer value "0" vs. "1"' => [
996  false,
997  '0', '1', 'int', false,
998  ],
999  // String with allowed NULL values
1000  'string with allowed null value "" vs. ""' => [
1001  true,
1002  '', '', 'string', true,
1003  ],
1004  'string with allowed null value 0 vs. "0"' => [
1005  true,
1006  0, '0', 'string', true,
1007  ],
1008  'string with allowed null value 1 vs. "1"' => [
1009  true,
1010  1, '1', 'string', true,
1011  ],
1012  'string with allowed null value "0" vs. ""' => [
1013  false,
1014  '0', '', 'string', true,
1015  ],
1016  'string with allowed null value 0 vs. ""' => [
1017  false,
1018  0, '', 'string', true,
1019  ],
1020  'string with allowed null value null vs. ""' => [
1021  false,
1022  null, '', 'string', true,
1023  ],
1024  'string with allowed null value "" vs. null' => [
1025  false,
1026  '', null, 'string', true,
1027  ],
1028  'string with allowed null value null vs. null' => [
1029  true,
1030  null, null, 'string', true,
1031  ],
1032  // Integer with allowed NULL values
1033  'integer with allowed null value 0 vs. 0' => [
1034  true,
1035  0, 0, 'int', true,
1036  ],
1037  'integer with allowed null value "0" vs. "0"' => [
1038  true,
1039  '0', '0', 'int', true,
1040  ],
1041  'integer with allowed null value 0 vs. "0"' => [
1042  true,
1043  0, '0', 'int', true,
1044  ],
1045  'integer with allowed null value "" vs. "0"' => [
1046  true,
1047  '', '0', 'int', true,
1048  ],
1049  'integer with allowed null value "" vs. 0' => [
1050  true,
1051  '', 0, 'int', true,
1052  ],
1053  'integer with allowed null value "0" vs. 0' => [
1054  true,
1055  '0', 0, 'int', true,
1056  ],
1057  'integer with allowed null value 1 vs. 1' => [
1058  true,
1059  1, 1, 'int', true,
1060  ],
1061  'integer with allowed null value "1" vs. "1"' => [
1062  true,
1063  '1', '1', 'int', true,
1064  ],
1065  'integer with allowed null value "1" vs. 1' => [
1066  true,
1067  '1', 1, 'int', true,
1068  ],
1069  'integer with allowed null value 1 vs. "1"' => [
1070  true,
1071  1, '1', 'int', true,
1072  ],
1073  'integer with allowed null value "0" vs. "1"' => [
1074  false,
1075  '0', '1', 'int', true,
1076  ],
1077  'integer with allowed null value null vs. ""' => [
1078  false,
1079  null, '', 'int', true,
1080  ],
1081  'integer with allowed null value "" vs. null' => [
1082  false,
1083  '', null, 'int', true,
1084  ],
1085  'integer with allowed null value null vs. null' => [
1086  true,
1087  null, null, 'int', true,
1088  ],
1089  'integer with allowed null value null vs. "0"' => [
1090  false,
1091  null, '0', 'int', true,
1092  ],
1093  'integer with allowed null value null vs. 0' => [
1094  false,
1095  null, 0, 'int', true,
1096  ],
1097  'integer with allowed null value "0" vs. null' => [
1098  false,
1099  '0', null, 'int', true,
1100  ],
1101  ];
1102  }
1107  public function ‪deletePagesOnRootLevelIsDenied(): void
1108  {
1109  $dataHandlerMock = $this->getMockBuilder(DataHandler::class)
1110  ->onlyMethods(['canDeletePage', 'log'])
1111  ->getMock();
1112  $dataHandlerMock
1113  ->expects(self::never())
1114  ->method('canDeletePage');
1115  $dataHandlerMock
1116  ->expects(self::once())
1117  ->method('log')
1118  ->with('pages', 0, 3, 0, 2, 'Deleting all pages starting from the root-page is disabled.', -1, [], 0);
1119 
1120  $dataHandlerMock->deletePages(0);
1121  }
1127  {
1128  $table = ‪StringUtility::getUniqueId('foo_');
1129  $conf = [
1130  'type' => 'inline',
1131  'foreign_table' => ‪StringUtility::getUniqueId('foreign_foo_'),
1132  'behaviour' => [
1133  'enableCascadingDelete' => 0,
1134  ],
1135  ];
1136 
1137  $mockRelationHandler = $this->createMock(RelationHandler::class);
1138  $mockRelationHandler->itemArray = [
1139  '1' => ['table' => ‪StringUtility::getUniqueId('bar_'), 'id' => 67],
1140  ];
1141 
1142  $mockDataHandler = $this->getAccessibleMock(DataHandler::class, ['getInlineFieldType', 'deleteAction', 'createRelationHandlerInstance'], [], '', false);
1143  $mockDataHandler->expects(self::once())->method('getInlineFieldType')->willReturn('field');
1144  $mockDataHandler->expects(self::once())->method('createRelationHandlerInstance')->willReturn($mockRelationHandler);
1145  $mockDataHandler->expects(self::never())->method('deleteAction');
1146  $mockDataHandler->deleteRecord_procBasedOnFieldType($table, 42, 'bar', $conf);
1147  }
1153  {
1154  return [
1155  'None item selected' => [
1156  0,
1157  0,
1158  ],
1159  'All items selected' => [
1160  7,
1161  7,
1162  ],
1163  'Item 1 and 2 are selected' => [
1164  3,
1165  3,
1166  ],
1167  'Value is higher than allowed (all checkboxes checked)' => [
1168  15,
1169  7,
1170  ],
1171  'Value is higher than allowed (some checkboxes checked)' => [
1172  11,
1173  3,
1174  ],
1175  'Negative value' => [
1176  -5,
1177  0,
1178  ],
1179  ];
1180  }
1181 
1190  public function ‪checkValue_checkReturnsExpectedValues($value, $expectedValue): void
1191  {
1192  $expectedResult = [
1193  'value' => $expectedValue,
1194  ];
1195  $result = [];
1196  $tcaFieldConfiguration = [
1197  'items' => [
1198  ['Item 1', 0],
1199  ['Item 2', 0],
1200  ['Item 3', 0],
1201  ],
1202  ];
1203  self::assertSame($expectedResult, $this->subject->_call('checkValueForCheck', $result, $value, $tcaFieldConfiguration, '', 0, 0, ''));
1204  }
1209  public function ‪checkValueForInputConvertsNullToEmptyString(): void
1210  {
1211  $expectedResult = ['value' => ''];
1212  self::assertSame($expectedResult, $this->subject->_call('checkValueForInput', null, ['type' => 'input', 'max' => 40], 'tt_content', 'NEW55c0e67f8f4d32.04974534', 89, 'table_caption'));
1213  }
1214 
1223  public function ‪referenceValuesAreCasted($value, array $configuration, bool $isNew, $expected): void
1224  {
1225  self::assertEquals(
1226  $expected,
1227  $this->subject->_call('castReferenceValue', $value, $configuration, $isNew)
1228  );
1229  }
1234  public function ‪referenceValuesAreCastedDataProvider(): array
1235  {
1236  return [
1237  'all empty' => [
1238  '', [], true, '',
1239  ],
1240  'cast zero with MM table' => [
1241  '', ['MM' => 'table'], true, 0,
1242  ],
1243  'cast zero with MM table with default value' => [
1244  '', ['MM' => 'table', 'default' => 13], true, 0,
1245  ],
1246  'cast zero with foreign field' => [
1247  '', ['foreign_field' => 'table', 'default' => 13], true, 0,
1248  ],
1249  'cast zero with foreign field with default value' => [
1250  '', ['foreign_field' => 'table'], true, 0,
1251  ],
1252  'pass zero' => [
1253  '0', [], true, '0',
1254  ],
1255  'pass value' => [
1256  '1', ['default' => 13], true, '1',
1257  ],
1258  'use default value' => [
1259  '', ['default' => 13], true, 13,
1260  ],
1261  ];
1262  }
1267  public function ‪clearPrefixFromValueRemovesPrefixDataProvider(): array
1268  {
1269  return [
1270  'normal case' => ['Test (copy 42)', 'Test'],
1271  // all cases below look fishy and indicate bugs
1272  'with double spaces before' => ['Test (copy 42)', 'Test '],
1273  'with three spaces before' => ['Test (copy 42)', 'Test '],
1274  'with space after' => ['Test (copy 42) ', 'Test (copy 42) '],
1275  'with double spaces after' => ['Test (copy 42) ', 'Test (copy 42) '],
1276  'with three spaces after' => ['Test (copy 42) ', 'Test (copy 42) '],
1277  'with double tab before' => ['Test' . "\t" . '(copy 42)', 'Test'],
1278  'with double tab after' => ['Test (copy 42)' . "\t", 'Test (copy 42)' . "\t"],
1279  ];
1280  }
1281 
1288  public function ‪clearPrefixFromValueRemovesPrefix(string $input, string $expected): void
1289  {
1290  $languageServiceProphecy = $this->prophesize(LanguageService::class);
1291  $languageServiceProphecy->sL('testLabel')->willReturn('(copy %s)');
1292  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
1293  ‪$GLOBALS['TCA']['testTable']['ctrl']['prependAtCopy'] = 'testLabel';
1294  self::assertEquals($expected, (new ‪DataHandler())->clearPrefixFromValue('testTable', $input));
1295  }
1296 
1297  public function ‪applyFiltersToValuesFiltersValuesDataProvider(): iterable
1298  {
1299  yield 'values are filtered by provided user function' => [
1300  'tcaFieldConfiguration' => [
1301  'filter' => [
1302  [
1303  'userFunc' => UserOddNumberFilter::class . '->filter',
1304  ],
1305  ],
1306  ],
1307  'values' => [1, 2, 3, 4, 5],
1308  'expected' => [1, 3, 5],
1309  ];
1310 
1311  yield 'parameters are passed to the user function' => [
1312  'tcaFieldConfiguration' => [
1313  'filter' => [
1314  [
1315  'userFunc' => UserOddNumberFilter::class . '->filter',
1316  'parameters' => [
1317  'exclude' => 1,
1318  ],
1319  ],
1320  ],
1321  ],
1322  'values' => [1, 2, 3, 4, 5],
1323  'expected' => [3, 5],
1324  ];
1325 
1326  yield 'no filters return value as is' => [
1327  'tcaFieldConfiguration' => [],
1328  'values' => [1, 2, 3, 4, 5],
1329  'expected' => [1, 2, 3, 4, 5],
1330  ];
1331  }
1332 
1337  public function ‪applyFiltersToValuesFiltersValues(array $tcaFieldConfiguration, array $values, array $expected): void
1338  {
1339  self::assertEqualsCanonicalizing($expected, $this->subject->_call('applyFiltersToValues', $tcaFieldConfiguration, $values));
1340  }
1345  public function ‪applyFiltersToValuesExpectsArray(): void
1346  {
1347  $tcaFieldConfiguration = [
1348  'filter' => [
1349  [
1350  'userFunc' => UserOddNumberFilter::class . '->filter',
1351  'parameters' => [
1352  'break' => true,
1353  ],
1354  ],
1355  ],
1356  ];
1357 
1358  $values = [1, 2, 3, 4, 5];
1359  $this->expectException(\RuntimeException::class);
1360  $this->expectExceptionCode(1336051942);
1361  $this->expectExceptionMessage('Expected userFunc filter "TYPO3\CMS\Core\Tests\Unit\DataHandling\Fixtures\UserOddNumberFilter->filter" to return an array. Got NULL.');
1362  $this->subject->_call('applyFiltersToValues', $tcaFieldConfiguration, $values);
1363  }
1364 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:86
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckDoesNotCallGetDateTimeFormatsForNonDatetimeFieldsDataProvider
‪array inputValueCheckDoesNotCallGetDateTimeFormatsForNonDatetimeFieldsDataProvider()
Definition: DataHandlerTest.php:473
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\$subject
‪DataHandler PHPUnit Framework MockObject MockObject AccessibleObjectInterface $subject
Definition: DataHandlerTest.php:55
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\logFormatsDetailMessageWithAdditionalDataInLocalErrorArray
‪logFormatsDetailMessageWithAdditionalDataInLocalErrorArray()
Definition: DataHandlerTest.php:873
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\doesCheckModifyAccessListHookGetsCalled
‪doesCheckModifyAccessListHookGetsCalled()
Definition: DataHandlerTest.php:586
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\nonAdminWithTableModifyAccessIsAllowedToModifyNonAdminTable
‪nonAdminWithTableModifyAccessIsAllowedToModifyNonAdminTable()
Definition: DataHandlerTest.php:109
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\referenceValuesAreCasted
‪referenceValuesAreCasted($value, array $configuration, bool $isNew, $expected)
Definition: DataHandlerTest.php:1219
‪TYPO3\CMS\Core\SysLog\Action
Definition: Cache.php:18
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\processDatamapForFrozenNonZeroWorkspaceReturnsFalse
‪processDatamapForFrozenNonZeroWorkspaceReturnsFalse()
Definition: DataHandlerTest.php:616
‪TYPO3\CMS\Core\Database\RelationHandler
Definition: RelationHandler.php:37
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\Fixtures\UserOddNumberFilter
Definition: UserOddNumberFilter.php:23
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckDoesNotCallGetDateTimeFormatsForNonDatetimeFields
‪inputValueCheckDoesNotCallGetDateTimeFormatsForNonDatetimeFields(array $tcaFieldConf)
Definition: DataHandlerTest.php:495
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\$backEndUser
‪BackendUserAuthentication $backEndUser
Definition: DataHandlerTest.php:59
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\doesCheckModifyAccessListThrowExceptionOnWrongHookInterface
‪doesCheckModifyAccessListThrowExceptionOnWrongHookInterface()
Definition: DataHandlerTest.php:572
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\nonAdminWithTableModifyAccessIsNotAllowedToModifyAdminTable
‪nonAdminWithTableModifyAccessIsNotAllowedToModifyAdminTable()
Definition: DataHandlerTest.php:137
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueInputEvalWithSaltedPasswordReturnsHashForSaltedPassword
‪checkValueInputEvalWithSaltedPasswordReturnsHashForSaltedPassword()
Definition: DataHandlerTest.php:219
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueInputEvalWithEvalDatetimeDataProvider
‪array checkValueInputEvalWithEvalDatetimeDataProvider()
Definition: DataHandlerTest.php:174
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\logDoesNotCallWriteLogOfBackendUserIfLoggingIsDisabled
‪logDoesNotCallWriteLogOfBackendUserIfLoggingIsDisabled()
Definition: DataHandlerTest.php:846
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckDbtypeIsIndependentFromTimezone
‪inputValueCheckDbtypeIsIndependentFromTimezone(string $value, string $dbtype, string $expectedOutput)
Definition: DataHandlerTest.php:546
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\$singletonInstances
‪array $singletonInstances
Definition: DataHandlerTest.php:51
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckRespectsRightLowerAndUpperLimitWithDefaultValueForDouble
‪inputValueCheckRespectsRightLowerAndUpperLimitWithDefaultValueForDouble($value, $expectedReturnValue)
Definition: DataHandlerTest.php:344
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValue_flex_procInData_travDS
‪checkValue_flex_procInData_travDS(array $dataValues, array $DSelements, array $expected)
Definition: DataHandlerTest.php:810
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueForInputConvertsNullToEmptyString
‪checkValueForInputConvertsNullToEmptyString()
Definition: DataHandlerTest.php:1205
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValue_checkReturnsExpectedValues
‪checkValue_checkReturnsExpectedValues($value, $expectedValue)
Definition: DataHandlerTest.php:1186
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\Fixtures\AllowAccessHookFixture
Definition: AllowAccessHookFixture.php:27
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\doesCheckModifyAccessListHookModifyAccessAllowed
‪doesCheckModifyAccessListHookModifyAccessAllowed()
Definition: DataHandlerTest.php:604
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\fixtureCanBeCreated
‪fixtureCanBeCreated()
Definition: DataHandlerTest.php:80
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckRecognizesDateTimeValuesAsIntegerValuesCorrectly
‪inputValueCheckRecognizesDateTimeValuesAsIntegerValuesCorrectly(string $value, int $expected)
Definition: DataHandlerTest.php:391
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\adminIsAllowedToModifyAdminTable
‪adminIsAllowedToModifyAdminTable()
Definition: DataHandlerTest.php:119
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\applyFiltersToValuesFiltersValues
‪applyFiltersToValuesFiltersValues(array $tcaFieldConfiguration, array $values, array $expected)
Definition: DataHandlerTest.php:1333
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\applyFiltersToValuesFiltersValuesDataProvider
‪applyFiltersToValuesFiltersValuesDataProvider()
Definition: DataHandlerTest.php:1293
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\referenceValuesAreCastedDataProvider
‪array referenceValuesAreCastedDataProvider()
Definition: DataHandlerTest.php:1230
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckRecognizesStringValuesAsIntegerValuesCorrectly
‪inputValueCheckRecognizesStringValuesAsIntegerValuesCorrectly(string $value, int $expectedReturnValue)
Definition: DataHandlerTest.php:269
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValuesStringsDataProvider
‪array inputValuesStringsDataProvider()
Definition: DataHandlerTest.php:233
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\logFormatsDetailMessageWithPlaceholders
‪logFormatsDetailMessageWithPlaceholders()
Definition: DataHandlerTest.php:888
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValuesDataTimeDataProvider
‪array inputValuesDataTimeDataProvider()
Definition: DataHandlerTest.php:362
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueInputEvalWithEvalDatetime
‪checkValueInputEvalWithEvalDatetime($input, $serverTimezone, $expectedOutput)
Definition: DataHandlerTest.php:191
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\applyFiltersToValuesExpectsArray
‪applyFiltersToValuesExpectsArray()
Definition: DataHandlerTest.php:1341
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueRangeCheckIsIgnoredWhenDefaultIsZeroAndInputValueIsEmpty
‪inputValueRangeCheckIsIgnoredWhenDefaultIsZeroAndInputValueIsEmpty($inputValue, string $expected, int $expectedEvalInt)
Definition: DataHandlerTest.php:443
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\doesCheckFlexFormValueHookGetsCalled
‪doesCheckFlexFormValueHookGetsCalled()
Definition: DataHandlerTest.php:630
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\clearPrefixFromValueRemovesPrefix
‪clearPrefixFromValueRemovesPrefix(string $input, string $expected)
Definition: DataHandlerTest.php:1284
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\nonAdminIsNorAllowedToModifyNonAdminTable
‪nonAdminIsNorAllowedToModifyNonAdminTable()
Definition: DataHandlerTest.php:100
‪TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools
Definition: FlexFormTools.php:40
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\logCallsWriteLogOfBackendUserIfLoggingIsEnabled
‪logCallsWriteLogOfBackendUserIfLoggingIsEnabled()
Definition: DataHandlerTest.php:834
‪TYPO3\CMS\Core\SysLog\Error
Definition: Error.php:24
‪TYPO3\CMS\Core\DataHandling\DataHandler\checkValue_input_Eval
‪array checkValue_input_Eval($value, $evalArray, $is_in, string $table='', $id='')
Definition: DataHandler.php:2529
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\Fixtures\InvalidHookFixture
Definition: InvalidHookFixture.php:23
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: DataHandlerTest.php:46
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckDbtypeIsIndependentFromTimezoneDataProvider
‪inputValueCheckDbtypeIsIndependentFromTimezoneDataProvider()
Definition: DataHandlerTest.php:503
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\adminIsAllowedToModifyNonAdminTable
‪adminIsAllowedToModifyNonAdminTable()
Definition: DataHandlerTest.php:91
‪TYPO3\CMS\Core\Tests\Unit\DataHandling
Definition: DataHandlerTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValuesRangeDoubleDataProvider
‪array inputValuesRangeDoubleDataProvider()
Definition: DataHandlerTest.php:288
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\setUp
‪setUp()
Definition: DataHandlerTest.php:64
‪$output
‪$output
Definition: annotationChecker.php:121
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:22
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueRangeCheckIsIgnoredWhenDefaultIsZeroAndInputValueIsEmptyDataProvider
‪inputValueRangeCheckIsIgnoredWhenDefaultIsZeroAndInputValueIsEmptyDataProvider()
Definition: DataHandlerTest.php:415
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\equalSubmittedAndStoredValuesAreDeterminedDataProvider
‪array equalSubmittedAndStoredValuesAreDeterminedDataProvider()
Definition: DataHandlerTest.php:922
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:128
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueInputEvalWithSaltedPasswordKeepsExistingHash
‪checkValueInputEvalWithSaltedPasswordKeepsExistingHash()
Definition: DataHandlerTest.php:207
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\inputValueCheckRespectsRightLowerAndUpperLimitForDouble
‪inputValueCheckRespectsRightLowerAndUpperLimitForDouble($value, $expectedReturnValue)
Definition: DataHandlerTest.php:324
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValue_flex_procInData_travDSDataProvider
‪checkValue_flex_procInData_travDSDataProvider()
Definition: DataHandlerTest.php:646
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\clearPrefixFromValueRemovesPrefixDataProvider
‪array clearPrefixFromValueRemovesPrefixDataProvider()
Definition: DataHandlerTest.php:1263
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\equalSubmittedAndStoredValuesAreDetermined
‪equalSubmittedAndStoredValuesAreDetermined($expected, $submittedValue, $storedValue, $storedType, $allowNull)
Definition: DataHandlerTest.php:911
‪TYPO3\CMS\Core\DataHandling\DataHandlerCheckModifyAccessListHookInterface
Definition: DataHandlerCheckModifyAccessListHookInterface.php:22
‪TYPO3\CMS\Core\DataHandling\DataHandler\process_datamap
‪bool void process_datamap()
Definition: DataHandler.php:766
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\logAddsEntryToLocalErrorLogArray
‪logAddsEntryToLocalErrorLogArray()
Definition: DataHandlerTest.php:858
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\nonAdminIsNotAllowedToModifyAdminTable
‪nonAdminIsNotAllowedToModifyAdminTable()
Definition: DataHandlerTest.php:128
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValueInputEvalWithEvalDouble2
‪checkValueInputEvalWithEvalDouble2()
Definition: DataHandlerTest.php:155
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest
Definition: DataHandlerTest.php:43
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\deleteRecord_procBasedOnFieldTypeRespectsEnableCascadingDelete
‪deleteRecord_procBasedOnFieldTypeRespectsEnableCascadingDelete()
Definition: DataHandlerTest.php:1122
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\deletePagesOnRootLevelIsDenied
‪deletePagesOnRootLevelIsDenied()
Definition: DataHandlerTest.php:1103
‪TYPO3\CMS\Core\Tests\Unit\DataHandling\DataHandlerTest\checkValue_checkReturnsExpectedValuesDataProvider
‪array checkValue_checkReturnsExpectedValuesDataProvider()
Definition: DataHandlerTest.php:1148