mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 22:23:37 +09:00
Merge commit '797bc2fd9811f86077e1aa3edd68593ab9dd5956' as 'includes/lib/action-scheduler'
This commit is contained in:
+37
@@ -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