function RendererLegacyTest::testDrupalProcessStates

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);
}

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