public function PostgresqlDateSqlTest::testGetDateFormat in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php \Drupal\Tests\views\Unit\Plugin\views\query\PostgresqlDateSqlTest::testGetDateFormat()
Tests date formatting replacement.
@covers ::getDateFormat
@dataProvider providerTestGetDateFormat
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ views/ query/ PostgresqlDateSqlTest.php, line 55
Class
- PostgresqlDateSqlTest
- Tests the PostgreSQL-specific date query handler.
Namespace
Drupal\Tests\views\Unit\Plugin\views\queryCode
public function testGetDateFormat($field, $format, $expected_format) {
$date_sql = new PostgresqlDateSql($this->database);
$this
->assertEquals("TO_CHAR({$field}, '{$expected_format}')", $date_sql
->getDateFormat($field, $format));
}