2020-06-05 01:51:25 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Mock DateTime Provider.
|
|
|
|
*
|
2020-08-11 19:18:47 +00:00
|
|
|
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
|
2020-06-05 01:51:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
use Automattic\WooCommerce\Admin\DateTimeProvider\DateTimeProviderInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mock DateTime Provider.
|
|
|
|
*/
|
|
|
|
class MockDateTimeProvider implements DateTimeProviderInterface {
|
|
|
|
/**
|
|
|
|
* Construct the mock DateTime provider using the specified value for now.
|
|
|
|
*
|
|
|
|
* @param DateTime $now The value to use for now.
|
|
|
|
*/
|
|
|
|
public function __construct( $now ) {
|
|
|
|
$this->now = $now;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the specified DateTime.
|
|
|
|
*
|
|
|
|
* @return DateTime
|
|
|
|
*/
|
|
|
|
public function get_now() {
|
|
|
|
return $this->now;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|