function TextfieldTest::testValueCallback

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php \Drupal\Tests\Core\Render\Element\TextfieldTest::testValueCallback()
  2. 10 core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php \Drupal\Tests\Core\Render\Element\TextfieldTest::testValueCallback()
  3. 11.x core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php \Drupal\Tests\Core\Render\Element\TextfieldTest::testValueCallback()

@covers ::valueCallback

@dataProvider providerTestValueCallback

File

core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php, line 20

Class

TextfieldTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21Textfield.php/class/Textfield/8.9.x" title="Provides a one-line text field form element." class="local">\Drupal\Core\Render\Element\Textfield</a> @group Render

Namespace

Drupal\Tests\Core\Render\Element

Code

public function testValueCallback($expected, $input) {
    $element = [];
    $form_state = $this->prophesize(FormStateInterface::class)
        ->reveal();
    $this->assertSame($expected, Textfield::valueCallback($element, $input, $form_state));
}

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