public function ConnectionTest::testQueryTrim in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testQueryTrim()
- 9 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 595
Class
- ConnectionTest
- Tests the Connection class.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testQueryTrim($expected, $query, $options) {
$mock_pdo = $this
->getMockBuilder(StubPdo::class)
->getMock();
$connection = new StubConnection($mock_pdo, []);
$preprocess_method = new \ReflectionMethod($connection, 'preprocessStatement');
$preprocess_method
->setAccessible(TRUE);
$this
->assertSame($expected, $preprocess_method
->invoke($connection, $query, $options));
}