function FormStateDecoratorBaseTest::providerPrepareCallback

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::providerPrepareCallback()
  2. 10 core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::providerPrepareCallback()
  3. 11.x core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php \Drupal\Tests\Core\Form\FormStateDecoratorBaseTest::providerPrepareCallback()

Provides data to self::testPrepareCallback().

File

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

Class

FormStateDecoratorBaseTest
@coversDefaultClass \Drupal\Core\Form\FormStateDecoratorBase

Namespace

Drupal\Tests\Core\Form

Code

public function providerPrepareCallback() {
    $function = 'sleep';
    $shorthand_form_method = '::submit()';
    $closure = function () {
    };
    $static_method_string = __METHOD__;
    $static_method_array = [
        __CLASS__,
        __FUNCTION__,
    ];
    $object_method_array = [
        $this,
        __FUNCTION__,
    ];
    return [
        // A shorthand form method is generally expanded to become a method on an
        // object.
[
            $shorthand_form_method,
            $object_method_array,
        ],
        // Functions, closures, and static method calls generally remain the same.
[
            $function,
            $function,
        ],
        [
            $closure,
            $closure,
        ],
        [
            $static_method_string,
            $static_method_string,
        ],
        [
            $static_method_array,
            $static_method_array,
        ],
    ];
}

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