‪TYPO3CMS  11.5
TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest:

Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

static mixed getPropertyPath ($subject, $propertyPath)
 

Protected Attributes

 $testExtensionsToLoad = array( 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example' )
 
PostRepository $postRepository
 
PersistenceManager $persistenceManager
 

Detailed Description

Definition at line 37 of file QueryLocalizedDataTest.php.

Member Function Documentation

◆ assertObjectsProperties()

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

Compares array of domain objects with array containing properties values

Parameters
array$objects
array$expected‪array of expected property values [ ['property' => 'value'], ['property' => 'value2']]

Definition at line 1162 of file QueryLocalizedDataTest.php.

References TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\getPropertyPath().

Referenced by TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\postsWithoutRespectingSysLanguage(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\queryFirst5Posts(), and TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\queryPostsByProperty().

◆ customFindByUidOverlayDisabled()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::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 345 of file QueryLocalizedDataTest.php.

◆ customFindByUidOverlayEnabled()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::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 265 of file QueryLocalizedDataTest.php.

◆ findByUidNoOverlaysDefaultLanguage()

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

Test in default language, overlays disabled

Test:

Definition at line 142 of file QueryLocalizedDataTest.php.

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

◆ findByUidNoOverlaysLanguage()

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

Test in language uid:1, overlays disabled

Test:

Definition at line 221 of file QueryLocalizedDataTest.php.

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

◆ findByUidOverlayModeOnDefaultLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::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.

Note that with feature flag disabled, you'll get same result (not translated record) for both calls ->findByUid(2) and ->findByUid(11)

Test:

Definition at line 100 of file QueryLocalizedDataTest.php.

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

◆ findByUidOverlayModeOnLanguage()

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

Test in language uid:1, overlays enabled

Test:

Definition at line 182 of file QueryLocalizedDataTest.php.

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

◆ getPropertyPath()

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

This is a copy of the ObjectAccess::getPropertyPath, but with the fallback 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 1186 of file QueryLocalizedDataTest.php.

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

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

◆ postsWithoutRespectingSysLanguage()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::postsWithoutRespectingSysLanguage (   $languageUid,
  $overlay,
  $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
array$expected

Definition at line 1139 of file QueryLocalizedDataTest.php.

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

◆ postsWithoutRespectingSysLanguageDataProvider()

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

◆ queryFirst5Posts()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::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 836 of file QueryLocalizedDataTest.php.

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

◆ queryFirst5PostsDataProvider()

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

Definition at line 414 of file QueryLocalizedDataTest.php.

◆ queryPostsByProperty()

TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::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 1017 of file QueryLocalizedDataTest.php.

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

◆ queryPostsByPropertyDataProvider()

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

Definition at line 855 of file QueryLocalizedDataTest.php.

◆ setUp()

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

◆ setUpBasicFrontendEnvironment()

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

Member Data Documentation

◆ $persistenceManager

PersistenceManager TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::$persistenceManager
protected

Definition at line 47 of file QueryLocalizedDataTest.php.

◆ $postRepository

PostRepository TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest::$postRepository
protected

Definition at line 43 of file QueryLocalizedDataTest.php.

◆ $testExtensionsToLoad

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

Definition at line 39 of file QueryLocalizedDataTest.php.