function MysqlDateSqlTest::testGetDateField
Same name in other branches
- 9 core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testGetDateField()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testGetDateField()
- 11.x core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testGetDateField()
Tests the getDateField method.
@covers ::getDateField
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ views/ query/ MysqlDateSqlTest.php, line 40
Class
- MysqlDateSqlTest
- Tests the MySQL-specific date query handler.
Namespace
Drupal\Tests\views\Unit\Plugin\views\queryCode
public function testGetDateField() : void {
$date_sql = new MysqlDateSql($this->database);
$expected = 'foo.field';
$this->assertEquals($expected, $date_sql->getDateField('foo.field', TRUE));
$expected = "DATE_ADD('19700101', INTERVAL foo.field SECOND)";
$this->assertEquals($expected, $date_sql->getDateField('foo.field', FALSE));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.