public function MysqlDateSqlTest::testGetDateField in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\MysqlDateSqlTest::testGetDateField()
- 9 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 38
Class
- MysqlDateSqlTest
- Tests the MySQL-specific date query handler.
Namespace
Drupal\Tests\views\Unit\Plugin\views\queryCode
public function testGetDateField() {
$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));
}