You are here

public function ConfigEntityUpdaterTest::testUpdateException in Drupal 8

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()

@covers ::update

File

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

Class

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

Namespace

Drupal\KernelTests\Core\Config\Entity

Code

public function testUpdateException() {
  $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');
}