function ConnectionTest::providerEscapeDatabase

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::providerEscapeDatabase()
  2. 10 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::providerEscapeDatabase()

Data provider for testEscapeDatabase.

Return value

array An indexed array of where each value is an array of arguments to pass to testEscapeField. The first value is the expected value, and the second value is the value to test.

File

core/tests/Drupal/Tests/Core/Database/ConnectionTest.php, line 558

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public static function providerEscapeDatabase() {
    return [
        [
            '/name/',
            'name',
            [
                '/',
                '/',
            ],
        ],
        [
            '`backtick`',
            'backtick',
            [
                '`',
                '`',
            ],
        ],
        [
            'anything',
            'any.thing',
            [
                '',
                '',
            ],
        ],
        [
            '"name"',
            'name',
        ],
        [
            '[name]',
            'name',
            [
                '[',
                ']',
            ],
        ],
    ];
}

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