You are here

public function MysqlDateSqlTest::testSetTimezoneOffset in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testSetTimezoneOffset()
  2. 10 core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testSetTimezoneOffset()

Tests setting the database offset.

@covers ::setTimezoneOffset

File

core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php, line 90

Class

MysqlDateSqlTest
Tests the MySQL-specific date query handler.

Namespace

Drupal\Tests\views\Unit\Plugin\views\query

Code

public function testSetTimezoneOffset() {
  $database = $this
    ->prophesize(Connection::class);
  $database
    ->query("SET @@session.time_zone = '42'")
    ->shouldBeCalledTimes(1);
  $date_sql = new MysqlDateSql($database
    ->reveal());
  $date_sql
    ->setTimezoneOffset(42);
}