function FormStateTest::providerTestGetError

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

File

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

Class

FormStateTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Form%21FormState.php/class/FormState/9" title="Stores information about the state of a form." class="local">\Drupal\Core\Form\FormState</a>

Namespace

Drupal\Tests\Core\Form

Code

public 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.