function FormStateDecoratorBaseTest::providerPrepareCallback

Same name and namespace in other branches
  1. 9 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 1454

Class

FormStateDecoratorBaseTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Form%21FormStateDecoratorBase.php/class/FormStateDecoratorBase/8.9.x" title="Decorates another form state." class="local">\Drupal\Core\Form\FormStateDecoratorBase</a>

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.