mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 06:03:38 +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,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_DBStoreMigrator_Test
|
||||
* @group tables
|
||||
*/
|
||||
class ActionScheduler_DBStoreMigrator_Test extends ActionScheduler_UnitTestCase {
|
||||
|
||||
public function test_create_action_with_last_attempt_date() {
|
||||
$scheduled_date = as_get_datetime_object( strtotime( '-24 hours' ) );
|
||||
$last_attempt_date = as_get_datetime_object( strtotime( '-23 hours' ) );
|
||||
|
||||
$action = new ActionScheduler_FinishedAction( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, [], new ActionScheduler_SimpleSchedule( $scheduled_date ) );
|
||||
$store = new ActionScheduler_DBStoreMigrator();
|
||||
|
||||
$action_id = $store->save_action( $action, null, $last_attempt_date );
|
||||
$action_date = $store->get_date( $action_id );
|
||||
|
||||
$this->assertEquals( $last_attempt_date->format( 'U' ), $action_date->format( 'U' ) );
|
||||
|
||||
$action_id = $store->save_action( $action, $scheduled_date, $last_attempt_date );
|
||||
$action_date = $store->get_date( $action_id );
|
||||
|
||||
$this->assertEquals( $last_attempt_date->format( 'U' ), $action_date->format( 'U' ) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user