function EntityMethodConfigActionsTest::testSimpleConfigUpdateFailsOnEntities

Tests that the simpleConfigUpdate action cannot be used on entities.

@group legacy

File

core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php, line 260

Class

EntityMethodConfigActionsTest
@group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testSimpleConfigUpdateFailsOnEntities() : void {
  $view_display = $this->container
    ->get(EntityDisplayRepositoryInterface::class)
    ->getViewDisplay('entity_test_with_bundle', 'test');
  $view_display->save();
  $this->expectDeprecation('Using the simpleConfigUpdate config action on config entities is deprecated in drupal:11.2.0 and throws an exception in drupal:12.0.0. Use the setProperties action instead. See https://www.drupal.org/node/3515543');
  $this->configActionManager
    ->applyAction('simpleConfigUpdate', $view_display->getConfigDependencyName(), [
    'hidden.uid' => TRUE,
  ]);
}

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