You are here

protected function WebTestExtended::getRelativeDate in Scheduled Updates 8

Utility Function to get a date relative from current.

Parameters

string $modify: Relative date string, e.g. +1 month

string $format: PHP DateTime::format string.

Return value

string

2 calls to WebTestExtended::getRelativeDate()
EmbeddedScheduledUpdateTypeTestBase::createNodeWithUpdate in tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTestBase.php
IndependentScheduledUpdateTypeTest::checkRunningPromoteUpdates in tests/src/FunctionalJavascript/IndependentScheduledUpdateTypeTest.php
Checking adding and running updates.

File

tests/src/FunctionalJavascript/WebTestExtended.php, line 98
Contains \Drupal\Tests\scheduled_updates\WebTestExtended.

Class

WebTestExtended
BrowserTestBase plus project agnostic helper functions.

Namespace

Drupal\Tests\scheduled_updates\FunctionalJavascript

Code

protected function getRelativeDate($modify, $format = 'Y-m-d') {
  $date = new \DateTime();
  $date
    ->modify($modify);
  return $date
    ->format($format);
}