function ConnectionTest::providerTestPrefixTables

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

Data provider for testPrefixTables().

Return value

array Array of arrays with the following elements:

  • Expected result.
  • Table prefix.
  • Query to be prefixed.
  • Quote identifier.

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function providerTestPrefixTables() {
    return [
        [
            'SELECT * FROM test_table',
            'test_',
            'SELECT * FROM {table}',
            [
                '',
                '',
            ],
        ],
        [
            'SELECT * FROM "test_table"',
            'test_',
            'SELECT * FROM {table}',
            [
                '"',
                '"',
            ],
        ],
        [
            "SELECT * FROM 'test_table'",
            'test_',
            'SELECT * FROM {table}',
            [
                "'",
                "'",
            ],
        ],
        [
            "SELECT * FROM [test_table]",
            'test_',
            'SELECT * FROM {table}',
            [
                '[',
                ']',
            ],
        ],
    ];
}

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