mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Issue #46 and #53 - Fixed failing tests on Moodle 27 and coding style issues. Fixed static page to reload only after the planned duration time.
This commit is contained in:
@@ -220,7 +220,11 @@ class infopage {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
require($CFG->dirroot.'/auth/outage/views/info/content.php');
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
// Moodle 2.7 did not check for CLI mode, which was fixed later.
|
||||
if (!($CFG->branch == '27' && CLI_SCRIPT)) {
|
||||
echo $OUTPUT->footer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ class behat_auth_outage extends behat_base {
|
||||
$expected = ($action == 'Edit') ? 2 : 1; // Edit is an action through the title or button.
|
||||
$found = $this->can_i_see_action($action);
|
||||
if ($found != $expected) {
|
||||
throw new ExpectationException('"'.$action.'" action not found, expected '.$expected
|
||||
.' but found '.$found.'.', $this->getSession());
|
||||
throw new ExpectationException('"'.$action.'" action not found, expected '.$expected.
|
||||
' but found '.$found.'.', $this->getSession());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class infopagecontroller_test extends advanced_testcase {
|
||||
$html = $info->get_output();
|
||||
// Must find...
|
||||
self::assertContains('<!DOCTYPE html>', $html);
|
||||
self::assertContains('<meta http-equiv="refresh" ', $html);
|
||||
self::assertContains('<meta http-equiv="refresh" content="'.$outage->get_duration_planned().'">', $html); // Issue #53.
|
||||
self::assertContains('</html>', $html);
|
||||
self::assertContains($outage->get_title(), $html);
|
||||
self::assertContains($outage->get_description(), $html);
|
||||
|
||||
@@ -35,7 +35,7 @@ global $SITE;
|
||||
<html data-outage-id="<?php echo $viewbag['outage']->id; ?>">
|
||||
<head>
|
||||
<title><?php echo strip_tags($SITE->fullname); ?></title>
|
||||
<meta http-equiv="refresh" content="<?php echo (5 * 60); ?>">
|
||||
<meta http-equiv="refresh" content="<?php echo $viewbag['outage']->get_duration_planned(); ?>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user