SmsTestTime.php in SMS Framework 2.x
File
tests/modules/sms_test_time/src/SmsTestTime.php
View source
<?php
declare (strict_types=1);
namespace Drupal\sms_test_time;
use Drupal\Component\Datetime\TimeInterface;
class SmsTestTime implements TimeInterface {
protected $original;
protected $date;
public function __construct(TimeInterface $original) {
$this->original = $original;
$this->date = new \DateTimeImmutable('2:30pm 17 October 1997', new \DateTimeZone('UTC'));
}
public function getRequestTime() {
return $this->date
->format('U');
}
public function getRequestMicroTime() {
return $this->date
->format('U.u');
}
public function getCurrentTime() {
return $this->date
->format('U');
}
public function getCurrentMicroTime() {
return $this->date
->format('U.u');
}
}