‪TYPO3CMS  10.4
TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest:

Public Member Functions

 mapMapsArrayToObjectByCallingmapToObject ()
 
 mapSingleRowReturnsObjectFromPersistenceSessionIfAvailable ()
 
 thawPropertiesSetsPropertyValues ()
 
 thawPropertiesThrowsExceptionOnUnknownPropertyType ()
 
 fetchRelatedEagerReturnsNullForEmptyRelationHasOne ()
 
 fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne ()
 
 MapObjectToClassPropertyReturnsNullForEmptyRelationHasOne ()
 
 mapObjectToClassPropertyReturnsExistingObjectWithoutCallingFetchRelated ()
 
array mapDateTimeHandlesDifferentFieldEvaluationsDataProvider ()
 
 mapDateTimeHandlesDifferentFieldEvaluations ($value, $storageFormat, $expectedValue)
 
 testMapDateTimeHandlesSubclassesOfDateTime ()
 
 getPlainValueReturnsCorrectDateTimeFormat ()
 
 getPlainValueReturnsExpectedValues ($expectedValue, $input)
 
array getPlainValueReturnsExpectedValuesDataProvider ()
 
 getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy ()
 
 getPlainValueCallsGetUidOnDomainObjectInterfaceInput ()
 

Detailed Description

Test case

Definition at line 47 of file DataMapperTest.php.

Member Function Documentation

◆ fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne ( )

Test if fetchRelatedEager method returns empty array when $fieldValue = '' and relation type != RELATION_HAS_ONE

This is actually a functional test as it tests multiple units along with a very specific setup of dependencies.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 248 of file DataMapperTest.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_BELONGS_TO_MANY.

◆ fetchRelatedEagerReturnsNullForEmptyRelationHasOne()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::fetchRelatedEagerReturnsNullForEmptyRelationHasOne ( )

Test if fetchRelatedEager method returns NULL when $fieldValue = '' and relation type == RELATION_HAS_ONE

This is actually a functional test as it tests multiple units along with a very specific setup of dependencies.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 225 of file DataMapperTest.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_ONE.

◆ getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy ( )
Test:

Definition at line 466 of file DataMapperTest.php.

◆ getPlainValueCallsGetUidOnDomainObjectInterfaceInput()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::getPlainValueCallsGetUidOnDomainObjectInterfaceInput ( )
Test:

Definition at line 481 of file DataMapperTest.php.

◆ getPlainValueReturnsCorrectDateTimeFormat()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::getPlainValueReturnsCorrectDateTimeFormat ( )
Test:

Definition at line 413 of file DataMapperTest.php.

◆ getPlainValueReturnsExpectedValues()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::getPlainValueReturnsExpectedValues (   $expectedValue,
  $input 
)
Test:
‪@dataProvider getPlainValueReturnsExpectedValuesDataProvider

Definition at line 431 of file DataMapperTest.php.

◆ getPlainValueReturnsExpectedValuesDataProvider()

array TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::getPlainValueReturnsExpectedValuesDataProvider ( )
Returns
‪array

Definition at line 442 of file DataMapperTest.php.

◆ mapDateTimeHandlesDifferentFieldEvaluations()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::mapDateTimeHandlesDifferentFieldEvaluations (   $value,
  $storageFormat,
  $expectedValue 
)
Parameters
string | int | null$value
string | null$storageFormat
string | null$expectedValue
Test:
‪@dataProvider mapDateTimeHandlesDifferentFieldEvaluationsDataProvider

Definition at line 378 of file DataMapperTest.php.

◆ mapDateTimeHandlesDifferentFieldEvaluationsDataProvider()

array TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::mapDateTimeHandlesDifferentFieldEvaluationsDataProvider ( )

Data provider for date checks. Date will be stored based on UTC in the database. That's why it's not possible to check for explicit date strings but using the date('c') conversion instead, which considers the current local timezone setting.

Returns
‪array

Definition at line 359 of file DataMapperTest.php.

◆ mapMapsArrayToObjectByCallingmapToObject()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::mapMapsArrayToObjectByCallingmapToObject ( )

This test does not actually test anything rather than map calls both mocked methods getTargetType and mapSingleRow while completely ignoring the result of the method.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 56 of file DataMapperTest.php.

◆ mapObjectToClassPropertyReturnsExistingObjectWithoutCallingFetchRelated()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::mapObjectToClassPropertyReturnsExistingObjectWithoutCallingFetchRelated ( )

Test if mapObjectToClassProperty method returns objects that are already registered in the persistence session without query it from the persistence layer

This is actually a functional test as it tests multiple units along with a very specific setup of dependencies.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 298 of file DataMapperTest.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_ONE.

◆ MapObjectToClassPropertyReturnsNullForEmptyRelationHasOne()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::MapObjectToClassPropertyReturnsNullForEmptyRelationHasOne ( )

Test if fetchRelatedEager method returns NULL when $fieldValue = '' and relation type == RELATION_HAS_ONE without calling fetchRelated

This is actually a functional test as it tests multiple units along with a very specific setup of dependencies.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 272 of file DataMapperTest.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_ONE.

◆ mapSingleRowReturnsObjectFromPersistenceSessionIfAvailable()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::mapSingleRowReturnsObjectFromPersistenceSessionIfAvailable ( )

This test does not actually test anything rather than mapSingleRow delegates functionality to the persistence session which is a mock itself.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 88 of file DataMapperTest.php.

◆ testMapDateTimeHandlesSubclassesOfDateTime()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::testMapDateTimeHandlesSubclassesOfDateTime ( )
Test:

Definition at line 396 of file DataMapperTest.php.

◆ thawPropertiesSetsPropertyValues()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::thawPropertiesSetsPropertyValues ( )

This test has a far too complex setup to test a single unit. This actually is a functional test, accomplished by mocking the whole dependency chain. This test only tests code structure while it should test functionality.

Todo:
‪: Cover this functionality by a functional test
Test:

Definition at line 120 of file DataMapperTest.php.

◆ thawPropertiesThrowsExceptionOnUnknownPropertyType()

TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Mapper\DataMapperTest::thawPropertiesThrowsExceptionOnUnknownPropertyType ( )
Test:

Definition at line 176 of file DataMapperTest.php.