public function PostgresqlDateSqlTest::testSetTimezoneOffset in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\PostgresqlDateSqlTest::testSetTimezoneOffset()
Tests setting the database offset.
@covers ::setTimezoneOffset
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ views/ query/ PostgresqlDateSqlTest.php, line 90
Class
- PostgresqlDateSqlTest
- Tests the PostgreSQL-specific date query handler.
Namespace
Drupal\Tests\views\Unit\Plugin\views\queryCode
public function testSetTimezoneOffset() {
$database = $this
->prophesize(Connection::class);
$database
->query("SET TIME ZONE INTERVAL '42' HOUR TO MINUTE")
->shouldBeCalledTimes(1);
$date_sql = new PostgresqlDateSql($database
->reveal());
$date_sql
->setTimezoneOffset(42);
}