function FormStateDecoratorBaseTest::testPrepareCallback

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::testPrepareCallback()
  2. 9 core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::testPrepareCallback()
  3. 8.9.x core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::testPrepareCallback()
  4. main core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::testPrepareCallback()

Tests prepare callback.

Attributes

#[DataProvider('providerPrepareCallback')]

File

core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php, line 1401

Class

FormStateDecoratorBaseTest
Tests Drupal\Core\Form\FormStateDecoratorBase.

Namespace

Drupal\Tests\Core\Form

Code

public function testPrepareCallback($unprepared_callback, callable $prepared_callback) : void {
  $this->decoratedFormState
    ->prepareCallback(Argument::is($unprepared_callback))
    ->willReturn($prepared_callback)
    ->shouldBeCalled();
  $this->assertSame($prepared_callback, $this->formStateDecoratorBase
    ->prepareCallback($unprepared_callback));
}

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