‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest:

Public Member Functions

array calcAgeDataProvider ()
 
 calcAgeReturnsExpectedValues ($seconds, $expectedLabel)
 
 getProcessedValueForZeroStringIsZero ()
 
 getProcessedValueForGroup ()
 
 getProcessedValueForGroupWithOneAllowedTable ()
 
 getProcessedValueForGroupWithMultipleAllowedTables ()
 
 getProcessedValueForSelectWithMMRelation ()
 
 getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent ()
 
array inputTypeDateDisplayOptions ()
 
 getProcessedValueHandlesAgeDisplayCorrectly ($input, $expected)
 
 getProcessedValueForCheckWithSingleItem ()
 
 getProcessedValueForCheckWithSingleItemInvertStateDisplay ()
 
array getCommonSelectFieldsReturnsCorrectFieldsDataProvider ()
 
 getCommonSelectFieldsReturnsCorrectFields ($table, $prefix='', array $presetFields, array $tca, $expectedFields='')
 
array getLabelFromItemlistReturnsCorrectFieldsDataProvider ()
 
 getLabelFromItemlistReturnsCorrectFields ($table, $col='', $key='', array $tca, $expectedLabel='')
 
array getLabelFromItemListMergedReturnsCorrectFieldsDataProvider ()
 
 getLabelFromItemListMergedReturnsCorrectFields ($pageId, $table, $column='', $key='', array $tca, $expectedLabel='')
 
 getFuncCheckReturnsInputTagWithValueAttribute ()
 
array getLabelsFromItemsListDataProvider ()
 
 getLabelsFromItemsListReturnsCorrectValue ($table, $col, $keyList, $tca, array $pageTsConfig, $expectedLabel)
 
 getProcessedValueReturnsLabelsForExistingValuesSolely ()
 
 getProcessedValueReturnsPlainValueIfItemIsNotFound ()
 
 viewOnClickReturnsOnClickCodeWithAlternativeUrl ()
 
 dateTimeAgeReturnsCorrectValues ()
 
 purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore ()
 
 purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore ()
 
 splitTableUidDataProvider ()
 
 splitTableUid ($input, $expected)
 
 getPagesTSconfigWorksWithoutInitializedBackendUser ()
 
 returnNullForMissingTcaConfigInResolveFileReferences ()
 
 fixVersioningPidDoesNotChangeValuesForNoBeUserAvailable ()
 
 returnNullForUnfitTableConfigInResolveFileReferences (array $config)
 
 unfitResolveFileReferencesTableConfig ()
 
 workspaceOLDoesNotChangeValuesForNoBeUserAvailable ()
 
 versioningPlaceholderClauseReturnsEmptyIfNoBeUserIsAvailable ()
 
 resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable ()
 
 getWorkspaceWhereClauseReturnsEmptyIfNoBeUserIsAvailable ()
 
 wsMapIdReturnsLiveIdIfNoBeUserIsAvailable ()
 
 getMovePlaceholderReturnsFalseIfNoBeUserIsAvailable ()
 

Protected Member Functions

array mockDatabaseConnection ($tableName='sys_category')
 

Protected Attributes

bool $resetSingletonInstances = true
 

Detailed Description

Test case

Definition at line 48 of file BackendUtilityTest.php.

Member Function Documentation

◆ calcAgeDataProvider()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::calcAgeDataProvider ( )

Data provider for calcAge function

Returns
‪array

Definition at line 62 of file BackendUtilityTest.php.

◆ calcAgeReturnsExpectedValues()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::calcAgeReturnsExpectedValues (   $seconds,
  $expectedLabel 
)
Test:
‪@dataProvider calcAgeDataProvider
Parameters
int$seconds
string$expectedLabel

Definition at line 143 of file BackendUtilityTest.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\calcAge().

◆ dateTimeAgeReturnsCorrectValues()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::dateTimeAgeReturnsCorrectValues ( )

◆ fixVersioningPidDoesNotChangeValuesForNoBeUserAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::fixVersioningPidDoesNotChangeValuesForNoBeUserAvailable ( )

◆ getCommonSelectFieldsReturnsCorrectFields()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getCommonSelectFieldsReturnsCorrectFields (   $table,
  $prefix = '',
array  $presetFields,
array  $tca,
  $expectedFields = '' 
)
Test:
‪@dataProvider getCommonSelectFieldsReturnsCorrectFieldsDataProvider
Parameters
string$table
string$prefix
array$presetFields
array$tca
string$expectedFields

Definition at line 622 of file BackendUtilityTest.php.

References $GLOBALS, $tca, and TYPO3\CMS\Backend\Utility\BackendUtility\getCommonSelectFields().

◆ getCommonSelectFieldsReturnsCorrectFieldsDataProvider()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getCommonSelectFieldsReturnsCorrectFieldsDataProvider ( )

Tests concerning getCommonSelectFields Data provider for getCommonSelectFieldsReturnsCorrectFields

Returns
‪array The test data with $table, $prefix, $presetFields, $tca, $expectedFields

Definition at line 517 of file BackendUtilityTest.php.

◆ getFuncCheckReturnsInputTagWithValueAttribute()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getFuncCheckReturnsInputTagWithValueAttribute ( )

Tests concerning getFuncCheck

Test:

Definition at line 799 of file BackendUtilityTest.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getFuncCheck().

◆ getLabelFromItemListMergedReturnsCorrectFields()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelFromItemListMergedReturnsCorrectFields (   $pageId,
  $table,
  $column = '',
  $key = '',
array  $tca,
  $expectedLabel = '' 
)
Test:
‪@dataProvider getLabelFromItemListMergedReturnsCorrectFieldsDataProvider
Parameters
int$pageId
string$table
string$column
string$key
array$tca
string$expectedLabel

Definition at line 785 of file BackendUtilityTest.php.

References $GLOBALS, $tca, and TYPO3\CMS\Backend\Utility\BackendUtility\getLabelFromItemListMerged().

◆ getLabelFromItemListMergedReturnsCorrectFieldsDataProvider()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelFromItemListMergedReturnsCorrectFieldsDataProvider ( )

Tests concerning getLabelFromItemListMerged Data provider for getLabelFromItemListMerged

Returns
‪array The test data with $pageId, $table, $column, $key, $expectedLabel

Definition at line 728 of file BackendUtilityTest.php.

◆ getLabelFromItemlistReturnsCorrectFields()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelFromItemlistReturnsCorrectFields (   $table,
  $col = '',
  $key = '',
array  $tca,
  $expectedLabel = '' 
)
Test:
‪@dataProvider getLabelFromItemlistReturnsCorrectFieldsDataProvider
Parameters
string$table
string$col
string$key
array$tca
string$expectedLabel

Definition at line 712 of file BackendUtilityTest.php.

References $GLOBALS, $tca, and TYPO3\CMS\Backend\Utility\BackendUtility\getLabelFromItemlist().

◆ getLabelFromItemlistReturnsCorrectFieldsDataProvider()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelFromItemlistReturnsCorrectFieldsDataProvider ( )

Tests concerning getLabelFromItemlist Data provider for getLabelFromItemlistReturnsCorrectFields

Returns
‪array The test data with $table, $col, $key, $expectedLabel

Definition at line 638 of file BackendUtilityTest.php.

◆ getLabelsFromItemsListDataProvider()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelsFromItemsListDataProvider ( )
Returns
‪array

Definition at line 811 of file BackendUtilityTest.php.

◆ getLabelsFromItemsListReturnsCorrectValue()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getLabelsFromItemsListReturnsCorrectValue (   $table,
  $col,
  $keyList,
  $tca,
array  $pageTsConfig,
  $expectedLabel 
)
Test:
‪@dataProvider getLabelsFromItemsListDataProvider
Parameters
string$table
string$col
string$keyList
array$tca
array$pageTsConfig
string$expectedLabel

Definition at line 869 of file BackendUtilityTest.php.

References $GLOBALS, $tca, and TYPO3\CMS\Backend\Utility\BackendUtility\getLabelsFromItemsList().

◆ getMovePlaceholderReturnsFalseIfNoBeUserIsAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getMovePlaceholderReturnsFalseIfNoBeUserIsAvailable ( )

◆ getPagesTSconfigWorksWithoutInitializedBackendUser()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getPagesTSconfigWorksWithoutInitializedBackendUser ( )

Tests if the method getPagesTSconfig can be called without having a GLOBAL['BE_USER'] object. However, this test also shows all the various other dependencies this method has.

Test:

Definition at line 1040 of file BackendUtilityTest.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig().

◆ getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent ( )

◆ getProcessedValueForCheckWithSingleItem()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForCheckWithSingleItem ( )

◆ getProcessedValueForCheckWithSingleItemInvertStateDisplay()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForCheckWithSingleItemInvertStateDisplay ( )

◆ getProcessedValueForGroup()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForGroup ( )

◆ getProcessedValueForGroupWithMultipleAllowedTables()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForGroupWithMultipleAllowedTables ( )

◆ getProcessedValueForGroupWithOneAllowedTable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForGroupWithOneAllowedTable ( )

◆ getProcessedValueForSelectWithMMRelation()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForSelectWithMMRelation ( )

◆ getProcessedValueForZeroStringIsZero()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueForZeroStringIsZero ( )

◆ getProcessedValueHandlesAgeDisplayCorrectly()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueHandlesAgeDisplayCorrectly (   $input,
  $expected 
)
Test:

@dataProvider inputTypeDateDisplayOptions

Parameters
string$input
string$expected

Definition at line 424 of file BackendUtilityTest.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\getProcessedValue().

◆ getProcessedValueReturnsLabelsForExistingValuesSolely()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueReturnsLabelsForExistingValuesSolely ( )

◆ getProcessedValueReturnsPlainValueIfItemIsNotFound()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getProcessedValueReturnsPlainValueIfItemIsNotFound ( )

◆ getWorkspaceWhereClauseReturnsEmptyIfNoBeUserIsAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::getWorkspaceWhereClauseReturnsEmptyIfNoBeUserIsAvailable ( )

◆ inputTypeDateDisplayOptions()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::inputTypeDateDisplayOptions ( )
Returns
‪array

Definition at line 394 of file BackendUtilityTest.php.

◆ mockDatabaseConnection()

array TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::mockDatabaseConnection (   $tableName = 'sys_category')
protected

Prepare a mock database setup for a Doctrine connection and return an array of all prophets to set expectations upon.

Parameters
string$tableName
Returns
‪array

Definition at line 247 of file BackendUtilityTest.php.

Referenced by TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest\getProcessedValueForSelectWithMMRelation().

◆ purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::purgeComputedPropertiesFromRecordRemovesPropertiesStartingWithUnderscore ( )

◆ purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::purgeComputedPropertyNamesRemovesPropertiesStartingWithUnderscore ( )

◆ resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::resolveFileReferencesReturnsEmptyResultForNoReferencesAvailable ( )

◆ returnNullForMissingTcaConfigInResolveFileReferences()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::returnNullForMissingTcaConfigInResolveFileReferences ( )

◆ returnNullForUnfitTableConfigInResolveFileReferences()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::returnNullForUnfitTableConfigInResolveFileReferences ( array  $config)
Test:
‪@dataProvider unfitResolveFileReferencesTableConfig

Definition at line 1110 of file BackendUtilityTest.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\resolveFileReferences().

◆ splitTableUid()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::splitTableUid (   $input,
  $expected 
)
Test:
‪@dataProvider splitTableUidDataProvider

Definition at line 1028 of file BackendUtilityTest.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\splitTable_Uid().

◆ splitTableUidDataProvider()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::splitTableUidDataProvider ( )

Definition at line 1006 of file BackendUtilityTest.php.

◆ unfitResolveFileReferencesTableConfig()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::unfitResolveFileReferencesTableConfig ( )

Definition at line 1118 of file BackendUtilityTest.php.

◆ versioningPlaceholderClauseReturnsEmptyIfNoBeUserIsAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::versioningPlaceholderClauseReturnsEmptyIfNoBeUserIsAvailable ( )

◆ viewOnClickReturnsOnClickCodeWithAlternativeUrl()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::viewOnClickReturnsOnClickCodeWithAlternativeUrl ( )

Tests concerning viewOnClick

Test:

Definition at line 944 of file BackendUtilityTest.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\viewOnClick().

◆ workspaceOLDoesNotChangeValuesForNoBeUserAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::workspaceOLDoesNotChangeValuesForNoBeUserAvailable ( )

◆ wsMapIdReturnsLiveIdIfNoBeUserIsAvailable()

TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::wsMapIdReturnsLiveIdIfNoBeUserIsAvailable ( )

Member Data Documentation

◆ $resetSingletonInstances

bool TYPO3\CMS\Backend\Tests\Unit\Utility\BackendUtilityTest::$resetSingletonInstances = true
protected

Definition at line 52 of file BackendUtilityTest.php.