function FormStateTest::providerTestGetError

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

File

core/tests/Drupal/Tests/Core/Form/FormStateTest.php, line 83

Class

FormStateTest
@coversDefaultClass \Drupal\Core\Form\FormState

Namespace

Drupal\Tests\Core\Form

Code

public static function providerTestGetError() {
    return [
        [
            [],
            [
                'foo',
            ],
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [],
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [
                'foo',
            ],
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [
                'bar',
            ],
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [
                'baz',
            ],
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [
                'foo',
                'bar',
            ],
            'Fail',
        ],
        [
            [
                'foo][bar' => 'Fail',
            ],
            [
                'foo',
                'bar',
                'baz',
            ],
            'Fail',
        ],
        [
            [
                'foo][bar' => 'Fail 2',
            ],
            [
                'foo',
            ],
        ],
        [
            [
                'foo' => 'Fail 1',
                'foo][bar' => 'Fail 2',
            ],
            [
                'foo',
            ],
            'Fail 1',
        ],
        [
            [
                'foo' => 'Fail 1',
                'foo][bar' => 'Fail 2',
            ],
            [
                'foo',
                'bar',
            ],
            'Fail 1',
        ],
    ];
}

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