mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
[fix] phpunit test
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
namespace auth_outage\dml;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
@@ -42,7 +40,7 @@ class outagecache{
|
||||
/**
|
||||
* Set active outage cache.
|
||||
*
|
||||
* @param outage|null $next_outage Next outage to save.
|
||||
* @param outage|null $next_outage Next outage to save, null for not setting outage.
|
||||
*/
|
||||
public static function set_active_outage_cache($next_outage = null) {
|
||||
$cache = \cache::make('auth_outage', 'cache_active_outage_data');
|
||||
@@ -51,6 +49,8 @@ class outagecache{
|
||||
|
||||
/**
|
||||
* Get active outage cache.
|
||||
*
|
||||
* @return outage|null Return the outage or null if cache not setted.
|
||||
*/
|
||||
public static function get_active_outage_cache() {
|
||||
$cache = \cache::make('auth_outage', 'cache_active_outage_data');
|
||||
@@ -60,7 +60,7 @@ class outagecache{
|
||||
/**
|
||||
* Set onging outage cache.
|
||||
*
|
||||
* @param outage|null $next_outage Onging outage to save.
|
||||
* @param outage|null $onging_outage Onging outage to save, null for not setting outage.
|
||||
*/
|
||||
public static function set_ongoing_outage_cache($onging_outage = null) {
|
||||
$cache = \cache::make('auth_outage', 'cache_ongoing_outage_data');
|
||||
@@ -69,6 +69,8 @@ class outagecache{
|
||||
|
||||
/**
|
||||
* Get onging outage cache.
|
||||
*
|
||||
* @return outage|null Return the outage or null if cache not setted.
|
||||
*/
|
||||
public static function get_ongoing_outage_cache() {
|
||||
$cache = \cache::make('auth_outage', 'cache_ongoing_outage_data');
|
||||
|
||||
@@ -151,7 +151,7 @@ class outagedb {
|
||||
}
|
||||
|
||||
// Set the next starting outage to cache after an outage is saved in db.
|
||||
outagecache::set_active_outage_cache(self::get_next_starting());
|
||||
outagecache::set_active_outage_cache(self::get_ongoing() ?? self::get_next_starting());
|
||||
|
||||
// Trigger outages modified events.
|
||||
outagelib::prepare_next_outage(true);
|
||||
@@ -193,7 +193,7 @@ class outagedb {
|
||||
calendar::delete($id);
|
||||
|
||||
// Set the next starting outage to cache after an outage is deleted in db.
|
||||
outagecache::set_active_outage_cache(self::get_next_starting());
|
||||
outagecache::set_active_outage_cache(self::get_ongoing() ?? self::get_next_starting());
|
||||
|
||||
// Trigger events.
|
||||
outagelib::prepare_next_outage();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->component = "auth_outage";
|
||||
$plugin->version = 2022120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2022120502; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->release = 2022120500; // Human-readable release information.
|
||||
$plugin->requires = 2017111309; // 2017111309 = T13, but this really requires 3.9 and higher.
|
||||
$plugin->maturity = MATURITY_STABLE; // Suitable for PRODUCTION environments!
|
||||
|
||||
Reference in New Issue
Block a user