protected function SchedulerDefaultTimeTest::setUp in Scheduler 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SchedulerDefaultTimeTest.php \Drupal\Tests\scheduler\Functional\SchedulerDefaultTimeTest::setUp()
Overrides SchedulerBrowserTestBase::setUp
File
- tests/
src/ Functional/ SchedulerDefaultTimeTest.php, line 43
Class
- SchedulerDefaultTimeTest
- Tests the default time functionality.
Namespace
Drupal\Tests\scheduler\FunctionalCode
protected function setUp() : void {
parent::setUp();
// For this test we use a default time of 6:30:15am.
$this->defaultTime = '06:30:15';
$config = $this
->config('scheduler.settings');
$config
->set('default_time', $this->defaultTime)
->save();
// Create DateTime objects to hold the two scheduling dates. This is better
// than using raw unix timestamps because it caters for daylight-saving
// shifts properly.
// @see https://www.drupal.org/project/scheduler/issues/2957490
$this->publishTime = new \DateTime();
$this->publishTime
->add(new \DateInterval('P1D'))
->setTime(6, 30, 15);
$this->unpublishTime = new \DateTime();
$this->unpublishTime
->add(new \DateInterval('P2D'))
->setTime(6, 30, 15);
}