You are here

public function MysqlDateSqlTest::testSetFieldTimezoneOffset 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::testSetFieldTimezoneOffset()
  2. 10 core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testSetFieldTimezoneOffset()

Tests timezone offset formatting.

@covers ::setFieldTimezoneOffset

File

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

Class

MysqlDateSqlTest
Tests the MySQL-specific date query handler.

Namespace

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

Code

public function testSetFieldTimezoneOffset() {
  $date_sql = new MysqlDateSql($this->database);
  $field = 'foobar.field';
  $date_sql
    ->setFieldTimezoneOffset($field, 42);
  $this
    ->assertEquals("(foobar.field + INTERVAL 42 SECOND)", $field);
}