function PhpExtensionsValidatorTest::providerPhpExtensionsValidation

Data provider for ::testPhpExtensionsValidation().

Return value

array[] The test cases.

File

core/modules/package_manager/tests/src/Kernel/PhpExtensionsValidatorTest.php, line 25

Class

PhpExtensionsValidatorTest
@covers \Drupal\package_manager\Validator\PhpExtensionsValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public static function providerPhpExtensionsValidation() : array {
    $openssl_error = ValidationResult::createError([
        t('The OpenSSL extension is not enabled, which is a security risk. See <a href="https://www.php.net/manual/en/openssl.installation.php">the PHP documentation</a> for information on how to enable this extension.'),
    ]);
    $xdebug_warning = ValidationResult::createWarning([
        t('Xdebug is enabled, which may have a negative performance impact on Package Manager and any modules that use it.'),
    ]);
    return [
        'xdebug enabled, openssl installed' => [
            [
                'xdebug',
                'openssl',
            ],
            [
                $xdebug_warning,
            ],
            [],
        ],
        'xdebug enabled, openssl not installed' => [
            [
                'xdebug',
            ],
            [
                $xdebug_warning,
                $openssl_error,
            ],
            [
                $openssl_error,
            ],
        ],
        'xdebug disabled, openssl installed' => [
            [
                'openssl',
            ],
            [],
            [],
        ],
        'xdebug disabled, openssl not installed' => [
            [],
            [
                $openssl_error,
            ],
            [
                $openssl_error,
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.