You are here

public function PostgresqlDateSqlTest::testSetTimezoneOffset in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\PostgresqlDateSqlTest::testSetTimezoneOffset()
  2. 10 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\query

Code

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);
}