You are here

public function RendererLegacyTest::testDrupalProcessStates in Drupal 8

Tests deprecation of the drupal_process_states() function.

@dataProvider providerElements

@expectedDeprecation drupal_process_states() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Form\FormHelper::processStates() instead. See https://www.drupal.org/node/3000069

File

core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php, line 48

Class

RendererLegacyTest
Deprecation tests cases for the render layer.

Namespace

Drupal\KernelTests\Core\Render

Code

public function testDrupalProcessStates($elements) {

  // Clone elements because processing changes array.
  $expected = $elements;
  drupal_process_states($expected);
  FormHelper::processStates($elements);
  $this
    ->assertEquals($expected, $elements);
}