You are here

public function ConfigEntityUpdaterTest::testUpdateOncePerUpdateException in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php \Drupal\KernelTests\Core\Config\Entity\ConfigEntityUpdaterTest::testUpdateOncePerUpdateException()
  2. 9 core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php \Drupal\KernelTests\Core\Config\Entity\ConfigEntityUpdaterTest::testUpdateOncePerUpdateException()

@covers ::update

File

core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php, line 132

Class

ConfigEntityUpdaterTest
Tests \Drupal\Core\Config\Entity\ConfigEntityUpdater.

Namespace

Drupal\KernelTests\Core\Config\Entity

Code

public function testUpdateOncePerUpdateException() {
  $this
    ->expectException(\RuntimeException::class);
  $this
    ->expectExceptionMessage('Updating multiple entity types in the same update function is not supported');
  $updater = $this->container
    ->get('class_resolver')
    ->getInstanceFromDefinition(ConfigEntityUpdater::class);
  $sandbox = [];
  $updater
    ->update($sandbox, 'config_test');
  $updater
    ->update($sandbox, 'config_query_test');
}