‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest:

Public Member Functions

 findByUidOverlayModeOnDefaultLanguage ()
 
 findByUidNoOverlaysDefaultLanguage ()
 
 findByUidOverlayModeOnLanguage ()
 
 findByUidNoOverlaysLanguage ()
 
 customFindByUidOverlayEnabled ()
 
 customFindByUidOverlayDisabled ()
 
 queryFirst5PostsDataProvider ()
 
 queryFirst5Posts ($languageUid, $overlay, $expected)
 
 queryPostsByPropertyDataProvider ()
 
 queryPostsByProperty ($languageUid, $overlay, $expected)
 
 postsWithoutRespectingSysLanguageDataProvider ()
 
 postsWithoutRespectingSysLanguage ($languageUid, $overlay, $languageMode, $expected)
 

Public Attributes

 $persistenceManager
 

Protected Member Functions

 setUp ()
 
 setUpBasicFrontendEnvironment ()
 
 assertObjectsProperties ($objects, $expected)
 

Static Protected Member Functions

static mixed getPropertyPath ($subject, $propertyPath)
 

Protected Attributes

array $testExtensionsToLoad = array( 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example' )
 
array $coreExtensionsToLoad = array( 'extbase', 'fluid' )
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
TYPO3 CMS Extbase Persistence Repository $postRepository
 
 PersistenceManager
 

Detailed Description

This test proves there is no regression between how Extbase query localized records in v8 and v9 The feature flag consistentTranslationOverlayHandling is off.

Definition at line 33 of file QueryLocalizedDataLegacyTest.php.

Member Function Documentation

◆ assertObjectsProperties()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::assertObjectsProperties (   $objects,
  $expected 
)
protected

◆ customFindByUidOverlayDisabled()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::customFindByUidOverlayDisabled ( )

This tests shows what query by uid returns depending on the language, and used uid (default language record or translated record uid). All with overlay mode disabled.

The post with uid 2 is translated to language 1, and there has uid 11.

Test:

Definition at line 346 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_ON.

◆ customFindByUidOverlayEnabled()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::customFindByUidOverlayEnabled ( )

This tests shows what query by uid returns depending on the language, and used uid (default language record or translated record uid). All with overlay mode enabled.

The post with uid 2 is translated to language 1, and there has uid 11.

Test:

Definition at line 268 of file QueryLocalizedDataLegacyTest.php.

◆ findByUidNoOverlaysDefaultLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::findByUidNoOverlaysDefaultLanguage ( )

Test in default language, overlays disabled

Test:

Definition at line 154 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_OFF.

◆ findByUidNoOverlaysLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::findByUidNoOverlaysLanguage ( )

Test in language uid:1, overlays disabled

Test:

Definition at line 224 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_OFF.

◆ findByUidOverlayModeOnDefaultLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::findByUidOverlayModeOnDefaultLanguage ( )

Test in default language

With overlays enabled it doesn't make a difference whether you call findByUid with translated record uid or default language record uid.

Test:

Definition at line 113 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_ON.

◆ findByUidOverlayModeOnLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::findByUidOverlayModeOnLanguage ( )

Test in language uid:1, overlays enabled

Test:

Definition at line 194 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_ON.

◆ getPropertyPath()

static mixed TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::getPropertyPath (   $subject,
  $propertyPath 
)
staticprotected

This is a copy of the ObjectAccess::getPropertyPath, but with third argument of getPropertyInternal set as true, to access protected properties, and iterator_to_array added.

Parameters
mixed$subjectObject or array to get the property path from
string$propertyPath
Returns
‪mixed Value of the property

Definition at line 1140 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Extbase\Reflection\ObjectAccess\getPropertyInternal().

Referenced by TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest\assertObjectsProperties().

◆ postsWithoutRespectingSysLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::postsWithoutRespectingSysLanguage (   $languageUid,
  $overlay,
  $languageMode,
  $expected 
)

This test demonstrates how query behaves when setRespectSysLanguage is set to false. The test now documents the wrong behaviour described in https://forge.typo3.org/issues/45873 and is connected with https://forge.typo3.org/issues/59992

The expected state is that when setRespectSysLanguage is false, then both: default language record, and translated language record should be returned. Now we're getting same record twice.

Test:
‪@dataProvider postsWithoutRespectingSysLanguageDataProvider
Parameters
int$languageUid
string | bool$overlay
string$languageMode
array$expected

Definition at line 1093 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest\assertObjectsProperties().

◆ postsWithoutRespectingSysLanguageDataProvider()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::postsWithoutRespectingSysLanguageDataProvider ( )

◆ queryFirst5Posts()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::queryFirst5Posts (   $languageUid,
  $overlay,
  $expected 
)

This test check posts returned by repository, when changing language and languageOverlayMode It also sets limit, offset to validate there are no "gaps" in pagination and sorting (on a posts property)

Test:
‪@dataProvider queryFirst5PostsDataProvider
Parameters
int$languageUid
bool$overlay
array$expected

Definition at line 842 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest\assertObjectsProperties(), and TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_ASCENDING.

◆ queryFirst5PostsDataProvider()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::queryFirst5PostsDataProvider ( )

Definition at line 432 of file QueryLocalizedDataLegacyTest.php.

◆ queryPostsByProperty()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::queryPostsByProperty (   $languageUid,
  $overlay,
  $expected 
)

This test check posts returned by repository, when filtering by property

"Post 6" is not translated "Post 5" is translated as "Post 5 - DK" "Post DK only" has no translation parent

Test:
‪@dataProvider queryPostsByPropertyDataProvider
Parameters
int$languageUid
bool$overlay
array$expected

Definition at line 979 of file QueryLocalizedDataLegacyTest.php.

References TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest\assertObjectsProperties(), and TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_ASCENDING.

◆ queryPostsByPropertyDataProvider()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::queryPostsByPropertyDataProvider ( )

Definition at line 861 of file QueryLocalizedDataLegacyTest.php.

◆ setUp()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::setUp ( )
protected

◆ setUpBasicFrontendEnvironment()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::setUpBasicFrontendEnvironment ( )
protected

Minimal frontend environment to satisfy Extbase Typo3DbBackend

Definition at line 86 of file QueryLocalizedDataLegacyTest.php.

References $GLOBALS, and TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_ON.

Referenced by TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest\setUp().

Member Data Documentation

◆ $coreExtensionsToLoad

array TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::$coreExtensionsToLoad = array( 'extbase', 'fluid' )
protected

Definition at line 41 of file QueryLocalizedDataLegacyTest.php.

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::$objectManager
protected

The object manager

Definition at line 45 of file QueryLocalizedDataLegacyTest.php.

◆ $persistenceManager

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::$persistenceManager

Definition at line 53 of file QueryLocalizedDataLegacyTest.php.

◆ $postRepository

TYPO3 CMS Extbase Persistence Repository TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::$postRepository
protected

Definition at line 49 of file QueryLocalizedDataLegacyTest.php.

◆ $testExtensionsToLoad

array TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::$testExtensionsToLoad = array( 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example' )
protected

Definition at line 37 of file QueryLocalizedDataLegacyTest.php.

◆ PersistenceManager

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataLegacyTest::PersistenceManager
protected

Definition at line 53 of file QueryLocalizedDataLegacyTest.php.