diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php index 2cfc1b32014..0fba72d8fc1 100644 --- a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php +++ b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php @@ -7,7 +7,6 @@ use Drupal\Core\Render\Markup; use Drupal\Tests\UnitTestCase; use Drupal\Core\Config\Config; use Drupal\Core\Config\ConfigValueException; -use PHPUnit\Framework\Error\Warning; /** * Tests the Config. @@ -270,7 +269,12 @@ class ConfigTest extends UnitTestCase { $this->config->set('testData', 1); // Attempt to treat the single value as a nested item. - $this->expectException(PHP_VERSION_ID >= 80000 ? \Error::class : Warning::class); + if (PHP_VERSION_ID >= 80000) { + $this->expectError(); + } + else { + $this->expectWarning(); + } $this->config->set('testData.illegalOffset', 1); }