You are here

public function ConnectionTest::providerEscapeTables in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::providerEscapeTables()

Data provider for testEscapeTable.

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 440

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function providerEscapeTables() {
  return [
    [
      'nocase',
      'nocase',
    ],
    [
      'camelCase',
      'camelCase',
    ],
    [
      'backtick',
      '`backtick`',
      [
        '`',
        '`',
      ],
    ],
    [
      'brackets',
      '[brackets]',
      [
        '[',
        ']',
      ],
    ],
    [
      'camelCase',
      '"camelCase"',
    ],
    [
      'camelCase',
      'camel/Case',
    ],
    // Sometimes, table names are following the pattern database.schema.table.
    [
      'camelCase.nocase.nocase',
      'camelCase.nocase.nocase',
    ],
    [
      'nocase.camelCase.nocase',
      'nocase.camelCase.nocase',
    ],
    [
      'nocase.nocase.camelCase',
      'nocase.nocase.camelCase',
    ],
    [
      'camelCase.camelCase.camelCase',
      'camelCase.camelCase.camelCase',
    ],
  ];
}