Squashed 'libraries/action-scheduler/' content from commit a95f351

git-subtree-dir: libraries/action-scheduler
git-subtree-split: a95f351058eada5e5281faa22e5a40865542e839
This commit is contained in:
2026-03-16 13:15:04 +01:00
commit d435f549fe
174 changed files with 32087 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?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() );
}
}