function ConnectionTest::testEscapeField

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

@covers ::escapeField
@dataProvider providerEscapeFields

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testEscapeField($expected, $name, array $identifier_quote = [
  '"',
  '"',
]) : void {
  $mock_pdo = $this->createMock(StubPDO::class);
  $connection = new StubConnection($mock_pdo, [], $identifier_quote);
  $this->assertEquals($expected, $connection->escapeField($name));
}

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