‪TYPO3CMS  ‪main
DataMapperTest.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;
32 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
43 
44 final class ‪DataMapperTest extends FunctionalTestCase
45 {
46  protected array ‪$testExtensionsToLoad = [
47  'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example',
48  'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper',
49  ];
50 
52 
53  protected function ‪setUp(): void
54  {
55  parent::setUp();
56  $this->persistenceManager = $this->get(PersistenceManager::class);
57  ‪$GLOBALS['BE_USER'] = new ‪BackendUserAuthentication();
58 
59  $request = (new ‪ServerRequest())->withAttribute('applicationType', ‪SystemEnvironmentBuilder::REQUESTTYPE_BE);
60  ‪$GLOBALS['TYPO3_REQUEST'] = $request;
61  }
62 
63  #[Test]
65  {
66  $example = new ‪DateExample();
67  $date = new \DateTime('2016-03-06T12:40:00+01:00');
68  $example->setDatetimeInt($date);
69 
70  $this->persistenceManager->add($example);
71  $this->persistenceManager->persistAll();
72  ‪$uid = $this->persistenceManager->getIdentifierByObject($example);
73  $this->persistenceManager->clearState();
74 
76  $example = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateExample::class);
77 
78  self::assertEquals($example->getDatetimeInt()->getTimestamp(), $date->getTimestamp());
79  }
80 
81  #[Test]
83  {
84  $example = new ‪DateExample();
85  $date = new \DateTime('2016-03-06T12:40:00+01:00');
86  $example->setDatetimeText($date);
87 
88  $this->persistenceManager->add($example);
89  $this->persistenceManager->persistAll();
90  ‪$uid = $this->persistenceManager->getIdentifierByObject($example);
91  $this->persistenceManager->clearState();
92 
94  $example = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateExample::class);
95 
96  self::assertEquals($example->getDatetimeText()->getTimestamp(), $date->getTimestamp());
97  }
98 
99  #[Test]
101  {
102  $example = new ‪DateExample();
103  $date = new \DateTime('2016-03-06T12:40:00');
104  $example->setDatetimeDatetime($date);
105 
106  $this->persistenceManager->add($example);
107  $this->persistenceManager->persistAll();
108  ‪$uid = $this->persistenceManager->getIdentifierByObject($example);
109  $this->persistenceManager->clearState();
110 
112  $example = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateExample::class);
113 
114  self::assertEquals($example->getDatetimeDatetime()->getTimestamp(), $date->getTimestamp());
115  }
116 
117  #[Test]
119  {
120  $subject = new ‪DateTimeImmutableExample();
121  $date = new \DateTimeImmutable('2018-07-24T20:40:00');
122  $subject->setDatetimeImmutableInt($date);
123 
124  $this->persistenceManager->add($subject);
125  $this->persistenceManager->persistAll();
126  ‪$uid = $this->persistenceManager->getIdentifierByObject($subject);
127  $this->persistenceManager->clearState();
128 
130  $subject = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateTimeImmutableExample::class);
131 
132  self::assertEquals($date, $subject->getDatetimeImmutableInt());
133  }
134 
135  #[Test]
137  {
138  $subject = new ‪DateTimeImmutableExample();
139  $date = new \DateTimeImmutable('2018-07-24T20:40:00');
140  $subject->setDatetimeImmutableText($date);
141 
142  $this->persistenceManager->add($subject);
143  $this->persistenceManager->persistAll();
144  ‪$uid = $this->persistenceManager->getIdentifierByObject($subject);
145  $this->persistenceManager->clearState();
146 
148  $subject = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateTimeImmutableExample::class);
149 
150  self::assertEquals($date, $subject->getDatetimeImmutableText());
151  }
152 
153  #[Test]
155  {
156  $subject = new ‪DateTimeImmutableExample();
157  $date = new \DateTimeImmutable('2018-07-24T20:40:00');
158  $subject->setDatetimeImmutableDatetime($date);
159 
160  $this->persistenceManager->add($subject);
161  $this->persistenceManager->persistAll();
162  ‪$uid = $this->persistenceManager->getIdentifierByObject($subject);
163  $this->persistenceManager->clearState();
164 
166  $subject = $this->persistenceManager->getObjectByIdentifier(‪$uid, DateTimeImmutableExample::class);
167 
168  self::assertSame($date->getTimestamp(), $subject->getDatetimeImmutableDatetime()->getTimestamp());
169  }
170 
171  #[Test]
172  public function ‪mapMapsArrayToObject(): void
173  {
174  $rows = [['uid' => 1234]];
175  $dataMapper = $this->get(DataMapper::class);
176 
177  $mappedObjectArray = $dataMapper->map(Blog::class, $rows);
178 
179  self::assertCount(1, $mappedObjectArray);
180  self::assertSame(1234, $mappedObjectArray[0]->getUid());
181  }
182 
183  #[Test]
185  {
186  $rows1 = [['uid' => 1234, 'title' => 'From persistence']];
187  $rows2 = [['uid' => 1234, 'title' => 'Already persisted']];
188  $dataMapper = $this->get(DataMapper::class);
189 
190  $dataMapper->map(Blog::class, $rows1);
191  $mappedObjectArray = $dataMapper->map(Blog::class, $rows2);
192 
193  self::assertCount(1, $mappedObjectArray);
194  self::assertSame(1234, $mappedObjectArray[0]->getUid());
195  self::assertSame('From persistence', $mappedObjectArray[0]->getTitle());
196  }
197 
198  #[Test]
199  public function ‪thawPropertiesThawsBackedEnum(): void
200  {
201  $rows = [[
202  'uid' => 1,
203  'string_backed_enum' => 'One',
204  'nullable_string_backed_enum' => 'One',
205  'integer_backed_enum' => 1,
206  'nullable_integer_backed_enum' => 1,
207  ]];
208 
210  $objects = $this->get(DataMapper::class)->map(Example::class, $rows);
211 
212  $object = $objects[0] ?? null;
213  self::assertInstanceOf(Example::class, $object);
214 
215  self::assertSame(‪StringBackedEnum::ONE, $object->stringBackedEnum);
216  self::assertSame(‪StringBackedEnum::ONE, $object->nullableStringBackedEnum);
217  self::assertSame(‪IntegerBackedEnum::ONE, $object->integerBackedEnum);
218  self::assertSame(‪IntegerBackedEnum::ONE, $object->nullableIntegerBackedEnum);
219  }
220 
221  #[Test]
223  {
224  $rows = [[
225  'uid' => 1,
226  'nullable_string_backed_enum' => 'Invalid',
227  'nullable_integer_backed_enum' => 0,
228  ]];
229 
231  $objects = $this->get(DataMapper::class)->map(Example::class, $rows);
232 
233  $object = $objects[0] ?? null;
234  self::assertInstanceOf(Example::class, $object);
235 
236  self::assertNull($object->nullableStringBackedEnum);
237  self::assertNull($object->nullableIntegerBackedEnum);
238  }
239 
240  #[Test]
241  public function ‪thawPropertiesSetsPropertyValues(): void
242  {
243  $rows = [
244  [
245  'uid' => '1234',
246  'first_property' => 'firstValue',
247  'second_property' => 1234,
248  'third_property' => 1.234,
249  'fourth_property' => false,
250  'uninitialized_string_property' => 'foo',
251  'uninitialized_date_time_property' => 0,
252  'uninitialized_mandatory_date_time_property' => 0,
253  'initialized_date_time_property' => 0,
254  ],
255  ];
256  $dataMapper = $this->get(DataMapper::class);
257 
258  $mappedObjectsArray = $dataMapper->map(Example::class, $rows);
259 
261  $object = $mappedObjectsArray[0];
262  self::assertEquals('firstValue', $object->getFirstProperty());
263  self::assertEquals(1234, $object->getSecondProperty());
264  self::assertEquals(1.234, $object->getThirdProperty());
265  self::assertFalse($object->isFourthProperty());
266  self::assertSame('foo', $object->getUninitializedStringProperty());
267  self::assertNull($object->getUninitializedDateTimeProperty());
268  $reflectionProperty = new \ReflectionProperty($object, 'uninitializedMandatoryDateTimeProperty');
269  self::assertFalse($reflectionProperty->isInitialized($object));
270  $reflectionProperty = new \ReflectionProperty($object, 'initializedDateTimeProperty');
271  self::assertTrue($reflectionProperty->isInitialized($object));
272  }
273 
274  #[Test]
276  {
277  $rows = [
278  [
279  'uid' => '1234',
280  'unknown_type' => 'What am I?',
281  ],
282  ];
283 
284  $dataMapper = $this->get(DataMapper::class);
285 
286  $this->expectException(UnknownPropertyTypeException::class);
287  $dataMapper->map(Example::class, $rows);
288  }
289 
290  #[Test]
292  {
293  $rows = [
294  [
295  'uid' => 123,
296  'blog' => '',
297  ],
298  ];
299  $dataMapper = $this->get(DataMapper::class);
300  $mappedObjectsArray = $dataMapper->map(Post::class, $rows);
301 
302  self::assertNull($mappedObjectsArray[0]->getBlog());
303  }
304 
305  #[Test]
307  {
308  $rows = [
309  [
310  'uid' => 123,
311  'posts' => 0,
312  ],
313  ];
314  $dataMapper = $this->get(DataMapper::class);
315  $mappedObjectsArray = $dataMapper->map(Blog::class, $rows);
316 
317  self::assertCount(0, $mappedObjectsArray[0]->getPosts());
318  }
319 
320  #[Test]
322  {
323  $blogRows = [
324  [
325  'uid' => 123,
326  'posts' => 1,
327  ],
328  ];
329  $dataMapper = $this->get(DataMapper::class);
330  $dataMapper->map(Blog::class, $blogRows);
331  $postRows = [
332  [
333  'uid' => 234,
334  'blog' => 123,
335  ],
336  ];
337 
338  $mappedObjectsArray = $dataMapper->map(Post::class, $postRows);
339 
340  self::assertSame(123, $mappedObjectsArray[0]->getBlog()->getUid());
341  }
342 
350  {
351  return [
352  'nothing' => [null, null, null],
353  'timestamp' => [1, null, date('c', 1)],
354  'invalid date' => ['0000-00-00', 'date', null],
355  'valid date' => ['2013-01-01', 'date', date('c', strtotime('2013-01-01 00:00:00'))],
356  'invalid datetime' => ['0000-00-00 00:00:00', 'datetime', null],
357  'valid datetime' => ['2013-01-01 01:02:03', 'datetime', date('c', strtotime('2013-01-01 01:02:03'))],
358  ];
359  }
360 
361  #[DataProvider('mapDateTimeHandlesDifferentFieldEvaluationsDataProvider')]
362  #[Test]
363  public function ‪mapDateTimeHandlesDifferentFieldEvaluations(string|int|null $value, string|null $storageFormat, string|null $expectedValue): void
364  {
365  ‪$GLOBALS['TCA']['tx_testdatamapper_domain_model_example']['columns']['initialized_date_time_property']['config']['dbType'] = $storageFormat;
366  $rows = [
367  [
368  'uid' => 123,
369  'initialized_date_time_property' => $value,
370  ],
371  ];
372  $dataMapper = $this->get(DataMapper::class);
373  $mappedObjectsArray = $dataMapper->map(Example::class, $rows);
374 
375  self::assertSame($expectedValue, $mappedObjectsArray[0]->getInitializedDateTimeProperty()?->format('c'));
376 
377  // Flush DataMapFactory cache on each run.
378  $cacheManager = $this->get(CacheManager::class);
379  $cacheManager->getCache('extbase')->flush();
380  }
381 
383  {
384  return [
385  'nothing' => [null, null, null],
386  'timestamp' => [1, null, '@1'],
387  'invalid date' => ['0000-00-00', 'date', null],
388  'valid date' => ['2013-01-01', 'date', '2013-01-01T00:00:00'],
389  'invalid datetime' => ['0000-00-00 00:00:00', 'datetime', null],
390  'valid datetime' => ['2013-01-01 01:02:03', 'datetime', '2013-01-01T01:02:03'],
391  ];
392  }
393 
394  #[DataProvider('mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZoneDataProvider')]
395  #[Test]
396  public function ‪mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZone(string|int|null $value, ?string $storageFormat, ?string $expectedValue): void
397  {
398  $originalTimeZone = date_default_timezone_get();
399  date_default_timezone_set('America/Chicago');
400  $usedTimeZone = date_default_timezone_get();
401 
402  ‪$GLOBALS['TCA']['tx_testdatamapper_domain_model_example']['columns']['initialized_date_time_property']['config']['dbType'] = $storageFormat;
403  $rows = [
404  [
405  'uid' => 123,
406  'initialized_date_time_property' => $value,
407  ],
408  ];
409  $dataMapper = $this->get(DataMapper::class);
410  $mappedObjectsArray = $dataMapper->map(Example::class, $rows);
411 
412  $expectedValue = $expectedValue !== null ? new \DateTime($expectedValue, new \DateTimeZone($usedTimeZone)) : $expectedValue;
413  self::assertEquals($expectedValue, $mappedObjectsArray[0]->getInitializedDateTimeProperty());
414 
415  // Flush DataMapFactory cache on each run.
416  $cacheManager = $this->get(CacheManager::class);
417  $cacheManager->getCache('extbase')->flush();
418 
419  // Restore the systems current timezone
420  date_default_timezone_set($originalTimeZone);
421  }
422 
423  #[Test]
425  {
426  $rows = [
427  [
428  'uid' => 123,
429  'custom_date_time' => '2013-01-01 01:02:03',
430  ],
431  ];
432  $dataMapper = $this->get(DataMapper::class);
433  $mappedObjectsArray = $dataMapper->map(Example::class, $rows);
434 
435  self::assertInstanceOf(CustomDateTime::class, $mappedObjectsArray[0]->getCustomDateTime());
436  }
437 
438  #[Test]
440  {
441  $dataMapper = $this->get(DataMapper::class);
442  $columnMapDateTime = new ‪ColumnMap('column_name');
443  $columnMapDateTime->setDateTimeStorageFormat('datetime');
444  $columnMapDate = new ‪ColumnMap('column_name');
445  $columnMapDate->setDateTimeStorageFormat('date');
446  $input = new \DateTime('2013-04-15 09:30:00');
447 
448  $plainValueDateTime = $dataMapper->getPlainValue($input, $columnMapDateTime);
449  $plainValueDate = $dataMapper->getPlainValue($input, $columnMapDate);
450 
451  self::assertSame('2013-04-15 09:30:00', $plainValueDateTime);
452  self::assertSame('2013-04-15', $plainValueDate);
453  }
454 
456  {
457  return [
458  'datetime to timestamp' => ['1365866253', new \DateTime('@1365866253')],
459  'boolean true to 1' => [1, true],
460  'boolean false to 0' => [0, false],
461  'NULL is handled as string' => ['NULL', null],
462  'string value is returned unchanged' => ['RANDOM string', 'RANDOM string'],
463  'array is flattened' => ['a,b,c', ['a', 'b', 'c']],
464  'deep array is flattened' => ['a,b,c', [['a', 'b'], 'c']],
465  'traversable domain object to identifier' => [1, new ‪TraversableDomainObjectExample()],
466  'integer value is returned unchanged' => [1234, 1234],
467  'float is converted to string' => ['1234.56', 1234.56],
468  'string backed enum converted to string' => ['One', ‪StringBackedEnum::ONE],
469  'int backed enum converted to int' => [1, ‪IntegerBackedEnum::ONE],
470  ];
471  }
472 
473  #[DataProvider('getPlainValueReturnsExpectedValuesDataProvider')]
474  #[Test]
475  public function ‪getPlainValueReturnsExpectedValues(string|int $expectedValue, mixed $input): void
476  {
477  $dataMapper = $this->get(DataMapper::class);
478 
479  $plainValue = $dataMapper->getPlainValue($input);
480 
481  self::assertSame($expectedValue, $plainValue);
482  }
483 
484  #[Test]
486  {
487  $this->importCSVDataSet(__DIR__ . '/Fixtures/DataMapperTestImport.csv');
488  $dataMapper = $this->get(DataMapper::class);
489  $rowsBlog = [
490  [
491  'uid' => 1234,
492  'administrator' => 1,
493  ],
494  ];
495  $mappedObjectArray = $dataMapper->map(Blog::class, $rowsBlog);
496 
497  $plainValue = $dataMapper->getPlainValue($mappedObjectArray[0]->getAdministrator());
498 
499  self::assertSame(1, $plainValue);
500  }
501 
502  #[Test]
504  {
505  $this->importCSVDataSet(__DIR__ . '/Fixtures/DataMapperTestImport.csv');
506 
507  $dataMapper = $this->get(DataMapper::class);
508 
509  $post = new ‪Post();
510  $post->_setProperty('uid', 1);
511 
512  // Act
513  $comments = $dataMapper->fetchRelated($post, 'comments', '5', false)->toArray();
514 
515  // Assert
516  self::assertSame(
517  [5, 4, 3, 2, 1], // foreign_default_sortby is set to uid desc, see
518  array_map(static fn(‪Comment $comment): int => $comment->‪getUid(), $comments)
519  );
520  }
521 
522  #[Test]
524  {
525  self::expectException(InvalidClassException::class);
526  self::expectExceptionCode(1234386924);
527  $subject = $this->get(DataMapper::class);
528  // Reflection since the method is protected
529  $subjectReflection = new \ReflectionObject($subject);
530  $subjectReflection->getMethod('createEmptyObject')->invoke($subject, \stdClass::class);
531  }
532 
533  #[Test]
535  {
536  self::expectException(\RuntimeException::class);
537  // 1680071491 is thrown, but not 1680071490!
538  self::expectExceptionCode(1680071491);
539  $subject = $this->get(DataMapper::class);
540  $subjectReflection = new \ReflectionObject($subject);
541  $subjectReflection->getMethod('createEmptyObject')->invoke($subject, HydrationFixtureEntity::class);
542  }
543 }
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\createEmptyObjectInstantiatesWithoutCallingTheConstructorButCallsInitializeObject
‪createEmptyObjectInstantiatesWithoutCallingTheConstructorButCallsInitializeObject()
Definition: DataMapperTest.php:534
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\Fixtures\HydrationFixtureEntity
Definition: HydrationFixtureEntity.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateValuesAreStoredInLocalTimeInDatetimeDatabaseFields
‪dateValuesAreStoredInLocalTimeInDatetimeDatabaseFields()
Definition: DataMapperTest.php:100
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\fetchRelatedRespectsForeignDefaultSortByTCAConfiguration
‪fetchRelatedRespectsForeignDefaultSortByTCAConfiguration()
Definition: DataMapperTest.php:503
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy
‪getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy()
Definition: DataMapperTest.php:485
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest
Definition: DataMapperTest.php:45
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapMapsArrayToObject
‪mapMapsArrayToObject()
Definition: DataMapperTest.php:172
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
Definition: SystemEnvironmentBuilder.php:41
‪TYPO3Tests\TestDataMapper\Domain\Model\Enum\ONE
‪@ ONE
Definition: IntegerBackedEnum.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap
Definition: ColumnMap.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\Exception\UnknownPropertyTypeException
Definition: UnknownPropertyTypeException.php:22
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateTimeImmutableTextIsHandledAsDateTime
‪dateTimeImmutableTextIsHandledAsDateTime()
Definition: DataMapperTest.php:136
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_BE
‪const REQUESTTYPE_BE
Definition: SystemEnvironmentBuilder.php:45
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZoneDataProvider
‪static mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZoneDataProvider()
Definition: DataMapperTest.php:382
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapObjectToClassPropertyReturnsExistingObjectWithoutCallingFetchRelated
‪mapObjectToClassPropertyReturnsExistingObjectWithoutCallingFetchRelated()
Definition: DataMapperTest.php:321
‪TYPO3Tests\TestDataMapper\Domain\Model\CustomDateTime
Definition: CustomDateTime.php:20
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne
‪fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne()
Definition: DataMapperTest.php:306
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
Definition: DataMapper.php:59
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper
Definition: ColumnMapFactoryTest.php:18
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidClassException
Definition: InvalidClassException.php:25
‪TYPO3Tests\BlogExample\Domain\Model\Comment
Definition: Comment.php:27
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\thawPropertiesThrowsExceptionOnUnknownPropertyType
‪thawPropertiesThrowsExceptionOnUnknownPropertyType()
Definition: DataMapperTest.php:275
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapDateTimeHandlesDifferentFieldEvaluations
‪mapDateTimeHandlesDifferentFieldEvaluations(string|int|null $value, string|null $storageFormat, string|null $expectedValue)
Definition: DataMapperTest.php:363
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\fetchRelatedEagerReturnsNullForEmptyRelationHasOne
‪fetchRelatedEagerReturnsNullForEmptyRelationHasOne()
Definition: DataMapperTest.php:291
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\getPlainValueReturnsCorrectDateTimeFormat
‪getPlainValueReturnsCorrectDateTimeFormat()
Definition: DataMapperTest.php:439
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\thawPropertiesThawsNullableBackedEnum
‪thawPropertiesThawsNullableBackedEnum()
Definition: DataMapperTest.php:222
‪TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
Definition: PersistenceManager.php:30
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateTimeImmutableIntIsHandledAsDateTime
‪dateTimeImmutableIntIsHandledAsDateTime()
Definition: DataMapperTest.php:118
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface\getUid
‪getUid()
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\thawPropertiesThawsBackedEnum
‪thawPropertiesThawsBackedEnum()
Definition: DataMapperTest.php:199
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\thawPropertiesSetsPropertyValues
‪thawPropertiesSetsPropertyValues()
Definition: DataMapperTest.php:241
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3Tests\BlogExample\Domain\Model\Post
Definition: Post.php:28
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:39
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:61
‪TYPO3Tests\TestDataMapper\Domain\Model\Enum\StringBackedEnum
‪StringBackedEnum
Definition: StringBackedEnum.php:21
‪TYPO3Tests\TestDataMapper\Domain\Model\TraversableDomainObjectExample
Definition: TraversableDomainObjectExample.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateTimeImmutableDateTimeIsHandledAsDateTime
‪dateTimeImmutableDateTimeIsHandledAsDateTime()
Definition: DataMapperTest.php:154
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapDateTimeHandlesDifferentFieldEvaluationsDataProvider
‪static mapDateTimeHandlesDifferentFieldEvaluationsDataProvider()
Definition: DataMapperTest.php:349
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateValuesAreStoredInUtcInIntegerDatabaseFields
‪dateValuesAreStoredInUtcInIntegerDatabaseFields()
Definition: DataMapperTest.php:64
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\dateValuesAreStoredInUtcInTextDatabaseFields
‪dateValuesAreStoredInUtcInTextDatabaseFields()
Definition: DataMapperTest.php:82
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapDateTimeHandlesSubclassesOfDateTime
‪mapDateTimeHandlesSubclassesOfDateTime()
Definition: DataMapperTest.php:424
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪TYPO3Tests\BlogExample\Domain\Model\Blog
Definition: Blog.php:30
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\$persistenceManager
‪PersistenceManager $persistenceManager
Definition: DataMapperTest.php:51
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\getPlainValueReturnsExpectedValues
‪getPlainValueReturnsExpectedValues(string|int $expectedValue, mixed $input)
Definition: DataMapperTest.php:475
‪TYPO3Tests\BlogExample\Domain\Model\DateTimeImmutableExample
Definition: DateTimeImmutableExample.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\setUp
‪setUp()
Definition: DataMapperTest.php:53
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\createEmptyObjectThrowsInvalidClassExceptionIfClassNameDoesNotImplementDomainObjectInterface
‪createEmptyObjectThrowsInvalidClassExceptionIfClassNameDoesNotImplementDomainObjectInterface()
Definition: DataMapperTest.php:523
‪TYPO3Tests\TestDataMapper\Domain\Model\Enum\IntegerBackedEnum
‪IntegerBackedEnum
Definition: IntegerBackedEnum.php:21
‪TYPO3Tests\BlogExample\Domain\Model\DateExample
Definition: DateExample.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\getPlainValueReturnsExpectedValuesDataProvider
‪static getPlainValueReturnsExpectedValuesDataProvider()
Definition: DataMapperTest.php:455
‪TYPO3Tests\TestDataMapper\Domain\Model\Example
Definition: Example.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZone
‪mapDateTimeHandlesDifferentFieldEvaluationsWithTimeZone(string|int|null $value, ?string $storageFormat, ?string $expectedValue)
Definition: DataMapperTest.php:396
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap
Definition: Relation.php:18
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: DataMapperTest.php:46
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapperTest\mapMapsArrayToObjectFromPersistence
‪mapMapsArrayToObjectFromPersistence()
Definition: DataMapperTest.php:184