function ConnectionTest::testInitCommandsOnConnect
Same name and namespace in other branches
- 11.x core/modules/pgsql/tests/src/Unit/ConnectionTest.php \Drupal\Tests\pgsql\Unit\ConnectionTest::testInitCommandsOnConnect()
Tests that init_commands are executed when opening a connection.
File
-
core/
modules/ pgsql/ tests/ src/ Unit/ ConnectionTest.php, line 39
Class
Namespace
Drupal\Tests\pgsql\UnitCode
public function testInitCommandsOnConnect() : void {
$pdo = $this->createMock(Pgsql::class);
$pdo->expects($this->once())
->method('exec')
->with("SET timezone = 'UTC'");
new Connection($pdo, [
'init_commands' => [
"SET timezone = 'UTC'",
],
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.