function EntityReferenceSelectionUnitTest::providerTestSetConfiguration

Provides test data for ::testSetConfiguration()

Return value

array

See also

\Drupal\Tests\Core\EntityReferenceSelection\testSetConfiguration

File

core/tests/Drupal/Tests/Core/EntityReferenceSelection/EntityReferenceSelectionUnitTest.php, line 58

Class

EntityReferenceSelectionUnitTest
Provides unit testing for selection handlers.

Namespace

Drupal\Tests\Core\EntityReferenceSelection

Code

public function providerTestSetConfiguration() {
    return [
        [
            [
                'setting1' => 'foo',
                'setting2' => [
                    'bar' => 'bar value',
                    'baz' => 'baz value',
                ],
            ],
        ],
        [
            [
                'handler_settings' => [
                    'setting1' => 'foo',
                    'setting2' => [
                        'bar' => 'bar value',
                        'baz' => 'baz value',
                    ],
                ],
            ],
        ],
        [
            [
                'setting1' => 'foo',
                'handler_settings' => [
                    'setting2' => [
                        'bar' => 'bar value',
                        'baz' => 'baz value',
                    ],
                ],
            ],
        ],
        [
            [
                'setting1' => 'foo',
                'setting2' => [
                    'bar' => 'bar value',
                    'baz' => 'baz value',
                ],
                'handler_settings' => [
                    // Same setting from root level takes precedence.
'setting2' => 'this will be overwritten',
                ],
            ],
        ],
    ];
}

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