Skip to content

Unable to test $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'] settings within functinal tests #682

@dkd-kaehm

Description

@dkd-kaehm

What are you trying to achieve?

I'm trying to setup the functional test considering the extension settings by using \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase::$configurationToUseInTestInstance property.

The properties description complains about merging but it overrules to unusable state:

/**
* This configuration array is merged with TYPO3_CONF_VARS
* that are set in default configuration and factory configuration
*
* @var array<string, mixed>
*/
protected array $configurationToUseInTestInstance = [];

What do you get instead?

The property overrules all the settings instead of merge them, so following lines are written
to $instancePath . '/typo3conf/system/settings.php' file.
The functionality with additional.php like on core is not possible in testing-framework.

$result = @file_put_contents(
$instancePath . '/typo3conf/system/settings.php',
'<?php' . chr(10) .
'return ' .
ArrayUtility::arrayExport(
$finalConfigurationArray
) .
';'
);

How to reproduce the issue?

Include some $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['your_ext']['someSetting'] = 1 and try to use other default settings from this extension configured in ext_conf_template.txt.

like:

    protected array $configurationToUseInTestInstance = [
        'EXTENSIONS' => [
            'your_ext' => [
                'someSetting' => 1,
            ],
        ],
    ];

All other values expected to present inside of $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'] are gone the core extensions loaded in base setup class as well.

Specify some data of the environment

  • TYPO3 testing framework version: 9.2.0
  • TYPO3 version: 13.4.17
  • TYPO3 installation type: composer
  • PHP version: 8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions