Squashed 'libraries/action-scheduler/' content from commit a95f351
git-subtree-dir: libraries/action-scheduler git-subtree-split: a95f351058eada5e5281faa22e5a40865542e839
This commit is contained in:
32
tests/phpunit/ActionScheduler_Mocker.php
Normal file
32
tests/phpunit/ActionScheduler_Mocker.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* ActionScheduler_Mocker class.
|
||||
*/
|
||||
class ActionScheduler_Mocker {
|
||||
|
||||
/**
|
||||
* Do not run queues via async requests.
|
||||
*
|
||||
* @param null|ActionScheduler_Store $store Store instance.
|
||||
*/
|
||||
public static function get_queue_runner( ?ActionScheduler_Store $store = null ) {
|
||||
|
||||
if ( ! $store ) {
|
||||
$store = ActionScheduler_Store::instance();
|
||||
}
|
||||
|
||||
return new ActionScheduler_QueueRunner( $store, null, null, self::get_async_request_queue_runner( $store ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of the mock queue runner
|
||||
*
|
||||
* @param ActionScheduler_Store $store Store instance.
|
||||
*/
|
||||
protected static function get_async_request_queue_runner( ActionScheduler_Store $store ) {
|
||||
return new ActionScheduler_Mock_AsyncRequest_QueueRunner( $store );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user