‪TYPO3CMS  10.4
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

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 $persistenceManager
 

Detailed Description

Definition at line 38 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 1182 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 365 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 285 of file QueryLocalizedDataTest.php.

◆ findByUidNoOverlaysDefaultLanguage()

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

Test in default language, overlays disabled

Test:

Definition at line 162 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 241 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 120 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 202 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 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 1206 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 1159 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 856 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 434 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 1037 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 875 of file QueryLocalizedDataTest.php.

◆ setUp()

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

◆ setUpBasicFrontendEnvironment()

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

Minimal frontend environment to satisfy Extbase Typo3DbBackend

Definition at line 90 of file QueryLocalizedDataTest.php.

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

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

Member Data Documentation

◆ $coreExtensionsToLoad

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

Definition at line 46 of file QueryLocalizedDataTest.php.

◆ $objectManager

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

The object manager

Definition at line 50 of file QueryLocalizedDataTest.php.

◆ $persistenceManager

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

Definition at line 58 of file QueryLocalizedDataTest.php.

◆ $postRepository

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

Definition at line 54 of file QueryLocalizedDataTest.php.

◆ $testExtensionsToLoad

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

Definition at line 42 of file QueryLocalizedDataTest.php.