$message=$this->t('The OpenSSL extension is not enabled, which is a security risk. See <a href=":url">the PHP documentation</a> for information on how to enable this extension.',[
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'],
[
ValidationResult::createWarning([
t('Xdebug is enabled, which may have a negative performance impact on Package Manager and any modules that use it.'),
]),
],
[$xdebug_warning],
[],
],
'xdebug enabled, openssl not installed'=>[
['xdebug'],
[
ValidationResult::createWarning([
t('Xdebug is enabled, which may have a negative performance impact on Package Manager and any modules that use it.'),
]),
ValidationResult::createWarning([
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,$openssl_error],
[$openssl_error],
],
'xdebug disabled, openssl installed'=>[
['openssl'],
[],
[],
],
'xdebug disabled, openssl not installed'=>[
[],
[
ValidationResult::createWarning([
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.'),
]),
],
[$openssl_error],
[$openssl_error],
],
];
}
...
...
@@ -61,17 +59,29 @@ class PhpExtensionsValidatorTest extends PackageManagerKernelTestBase {
* @param string[] $loaded_extensions
* The names of the PHP extensions that the validator should think are