You are here

public function ConnectionTest::providerEscapeAlias 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::providerEscapeAlias()

Data provider for testEscapeAlias.

Return value

array Array of arrays with the following elements:

  • Expected escaped string.
  • String to escape.

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function providerEscapeAlias() {
  return [
    [
      '!nocase!',
      'nocase',
      [
        '!',
        '!',
      ],
    ],
    [
      '`backtick`',
      'backtick',
      [
        '`',
        '`',
      ],
    ],
    [
      'nocase',
      'nocase',
      [
        '',
        '',
      ],
    ],
    [
      '[brackets]',
      'brackets',
      [
        '[',
        ']',
      ],
    ],
    [
      '"camelCase"',
      '"camelCase"',
    ],
    [
      '"camelCase"',
      'camelCase',
    ],
    [
      '"camelCase"',
      'camel.Case',
    ],
  ];
}