mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 13:13:33 +09:00
Squashed 'includes/lib/action-scheduler/' content from commit c82834771
git-subtree-dir: includes/lib/action-scheduler git-subtree-split: c828347715e6c3318c8ab8b4fea2d87b31d51aac
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_SimpleSchedule_Test
|
||||
* @group schedules
|
||||
*/
|
||||
class ActionScheduler_SimpleSchedule_Test extends ActionScheduler_UnitTestCase {
|
||||
public function test_creation() {
|
||||
$time = as_get_datetime_object();
|
||||
$schedule = new ActionScheduler_SimpleSchedule($time);
|
||||
$this->assertEquals( $time, $schedule->get_date() );
|
||||
}
|
||||
|
||||
public function test_past_date() {
|
||||
$time = as_get_datetime_object('-1 day');
|
||||
$schedule = new ActionScheduler_SimpleSchedule($time);
|
||||
$this->assertEquals( $time, $schedule->get_date() );
|
||||
}
|
||||
|
||||
public function test_future_date() {
|
||||
$time = as_get_datetime_object('+1 day');
|
||||
$schedule = new ActionScheduler_SimpleSchedule($time);
|
||||
$this->assertEquals( $time, $schedule->get_date() );
|
||||
}
|
||||
|
||||
public function test_grace_period_for_next() {
|
||||
$time = as_get_datetime_object('3 seconds ago');
|
||||
$schedule = new ActionScheduler_SimpleSchedule($time);
|
||||
$this->assertEquals( $time, $schedule->get_date() );
|
||||
}
|
||||
|
||||
public function test_is_recurring() {
|
||||
$schedule = new ActionScheduler_SimpleSchedule(as_get_datetime_object('+1 day'));
|
||||
$this->assertFalse( $schedule->is_recurring() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user