protected function DateTestBase::massageTestDate in Drupal 8
Same name in this branch
- 8 core/modules/datetime/src/Tests/DateTestBase.php \Drupal\datetime\Tests\DateTestBase::massageTestDate()
- 8 core/modules/datetime/tests/src/Functional/DateTestBase.php \Drupal\Tests\datetime\Functional\DateTestBase::massageTestDate()
Massages test date values.
If a date object is generated directly by a test, then it needs to be adjusted to behave like the computed date from the item.
Parameters
\Drupal\Core\Datetime\DrupalDateTime $date: A date object directly generated by the test.
File
- core/
modules/ datetime/ src/ Tests/ DateTestBase.php, line 201
Class
- DateTestBase
- Provides a base class for testing Datetime field functionality.
Namespace
Drupal\datetime\TestsCode
protected function massageTestDate($date) {
if ($this->field
->getSetting('datetime_type') === DateTimeItem::DATETIME_TYPE_DATE) {
// Set the default time for date-only items.
$date
->setDefaultDateTime();
}
}