function MysqlDateSqlTest::testSetTimezoneOffset

Same name 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. 8.9.x core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testSetTimezoneOffset()
  3. 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 92

Class

MysqlDateSqlTest
Tests the MySQL-specific date query handler.

Namespace

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

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.