function ConnectionTest::testQueryTrim
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testQueryTrim()
- 8.9.x core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testQueryTrim()
- 11.x core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testQueryTrim()
Test rtrim() of query strings.
@dataProvider provideQueriesToTrim
File
-
core/
tests/ Drupal/ Tests/ Core/ Database/ ConnectionTest.php, line 614
Class
- ConnectionTest
- Tests the Connection class.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testQueryTrim($expected, $query, $options) : void {
$mock_pdo = $this->getMockBuilder(StubPdo::class)
->getMock();
$connection = new StubConnection($mock_pdo, []);
$preprocess_method = new \ReflectionMethod($connection, 'preprocessStatement');
$this->assertSame($expected, $preprocess_method->invoke($connection, $query, $options));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.