function ConfigEntityUpdaterTest::testUpdateException

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php \Drupal\KernelTests\Core\Config\Entity\ConfigEntityUpdaterTest::testUpdateException()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php \Drupal\KernelTests\Core\Config\Entity\ConfigEntityUpdaterTest::testUpdateException()
  3. 10 core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php \Drupal\KernelTests\Core\Config\Entity\ConfigEntityUpdaterTest::testUpdateException()

@covers ::update

File

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

Class

ConfigEntityUpdaterTest
Tests <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21Entity%21ConfigEntityUpdater.php/class/ConfigEntityUpdater/11.x" title="A utility class to make updating configuration entities simple." class="local">\Drupal\Core\Config\Entity\ConfigEntityUpdater</a>.

Namespace

Drupal\KernelTests\Core\Config\Entity

Code

public function testUpdateException() : void {
    $this->enableModules([
        'entity_test',
    ]);
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('The provided entity type ID \'entity_test_mul_changed\' is not a configuration entity type');
    $updater = $this->container
        ->get('class_resolver')
        ->getInstanceFromDefinition(ConfigEntityUpdater::class);
    $sandbox = [];
    $updater->update($sandbox, 'entity_test_mul_changed');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.