Skip to content

Commit bf848a9

Browse files
committed
PHP 8.5 | Update tests involving the disable_classes ini setting
A number of tests verify the behaviour of PHPCS when a user tries to change a "php.ini only" ini setting, which should result in an error being displayed. Unfortunately, the ini setting which was being used for these tests will be removed as of PHP 8.5, so this commit switches out the `disable_classes` ini setting for the `expose_php` ini setting to still be able to verify the behaviour. Ref: * https://wiki.php.net/rfc/deprecations_php_8_5#remove_disable_classes_ini_setting * https://www.php.net/manual/en/ini.core.php
1 parent 2878bd7 commit bf848a9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tests/Core/Config/IniSetTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ public static function dataIniValueCannotBeUpdatedAtRuntime()
300300
return [
301301
// Using Core directives available PHP cross-version to prevent the tests failing
302302
// on an unavailable directive or due to an extension not being available.
303-
'php.ini only option: disable_classes' => [
304-
'option' => 'disable_classes',
305-
'newValue' => 'DateTime,DOMComment',
306-
'alternativeValue' => 'DOMComment,DateTime',
303+
'php.ini only option: expose_php' => [
304+
'option' => 'expose_php',
305+
'newValue' => '0',
306+
'alternativeValue' => '1',
307307
],
308308
'INI_PERDIR option: short_open_tag (bool)' => [
309309
'option' => 'short_open_tag',

tests/Core/Ruleset/IniSetFailIniOnlyTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="IniSetTest" xsi:noNamespaceSchemaLocation="phpcs.xsd">
33
<description>Ruleset to test ini values which can not be changed at runtime will be reported as such when set from the ruleset.</description>
44

5-
<ini name="disable_classes" value="DateTime,DOMComment"/>
5+
<ini name="expose_php" value="0"/>
66

77
<!-- Prevent a "no sniff were registered" error. -->
88
<rule ref="Generic.PHP.BacktickOperator"/>

tests/Core/Ruleset/ProcessRulesetIniSetTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ public static function dataIniValueCannotBeUpdatedAtRuntime()
116116
return [
117117
// Using Core directives available PHP cross-version to prevent the tests failing
118118
// on an unavailable directive or due to an extension not being available.
119-
'php.ini only option: disable_classes' => [
119+
'php.ini only option: expose_php' => [
120120
'standard' => __DIR__.'/IniSetFailIniOnlyTest.xml',
121-
'option' => 'disable_classes',
122-
'expected' => 'DateTime,DOMComment',
121+
'option' => 'expose_php',
122+
'expected' => '0',
123123
],
124124
'INI_PERDIR option: short_open_tag' => [
125125
'standard' => __DIR__.'/IniSetFailIniPerDirTest.xml',

0 commit comments

Comments
 (0)