You are here

public function TimeChanger::setCurrentTime in Content locking (anti-concurrent editing) 8

Same name and namespace in other branches
  1. 8.2 modules/content_lock_timeout/tests/modules/content_lock_timeout_test/src/TimeChanger.php \Drupal\content_lock_timeout_test\TimeChanger::setCurrentTime()

Forward current time to the given timestamp.

Parameters

int $time: New time to set.

File

modules/content_lock_timeout/tests/modules/content_lock_timeout_test/src/TimeChanger.php, line 33

Class

TimeChanger
This is a datetime.time service for testing only.

Namespace

Drupal\content_lock_timeout_test

Code

public function setCurrentTime($time) {
  \Drupal::keyValue('time')
    ->set('time', $time);
}