diff --git a/core/tests/Drupal/KernelTests/Core/UpdateLegacyTest.php b/core/tests/Drupal/KernelTests/Core/UpdateLegacyTest.php index 2f40484b42..bce272bd9d 100644 --- a/core/tests/Drupal/KernelTests/Core/UpdateLegacyTest.php +++ b/core/tests/Drupal/KernelTests/Core/UpdateLegacyTest.php @@ -2,6 +2,7 @@ namespace Drupal\KernelTests\Core; +use Drupal\Core\Config\ImmutableConfigException; use Drupal\KernelTests\KernelTestBase; use Drupal\Tests\user\Traits\UserCreationTrait; @@ -33,6 +34,8 @@ public function testUpdateReplacePermissions() { $old = 'access site reports'; $new = 'access content'; $user = $this->createUser([$old]); + // The function is broken so catching its error. + $this->expectException(ImmutableConfigException::class); update_replace_permissions([$old => [$old, $new]]); $this->assertTrue($user->hasPermission($new)); }