mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Issue #52 - Fixed static page.
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/phpunit/phpunit.xsd"
|
||||
bootstrap="../../../lib/phpunit/bootstrap.php"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
stopOnError="false"
|
||||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
printerClass="Hint_ResultPrinter"
|
||||
testSuiteLoaderClass="phpunit_autoloader"
|
||||
>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="auth_outage_testsuite">
|
||||
<directory suffix="_test.php">./</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="false">
|
||||
<directory suffix=".php">../classes</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\infopage_controller
|
||||
* @covers \auth_outage\local\controllers\infopage
|
||||
*/
|
||||
class infopagecontroller_test extends advanced_testcase {
|
||||
public function setUp() {
|
||||
@@ -63,10 +63,17 @@ class infopagecontroller_test extends advanced_testcase {
|
||||
]);
|
||||
$info = new infopage(['static' => true, 'outage' => $outage]);
|
||||
$html = $info->get_output();
|
||||
// Must find...
|
||||
self::assertContains('<!DOCTYPE html>', $html);
|
||||
self::assertContains('<meta http-equiv="refresh" ', $html);
|
||||
self::assertContains('</html>', $html);
|
||||
self::assertContains($outage->get_title(), $html);
|
||||
self::assertContains($outage->get_description(), $html);
|
||||
// Must not find...
|
||||
self::assertNotContains('<link ', $html);
|
||||
self::assertNotContains('<a ', $html);
|
||||
self::assertNotContains('<script ', $html);
|
||||
// Ensure it has the id encoded in it...
|
||||
self::assertSame($outage->id, infopage::find_outageid_from_infopage($html));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ global $SITE;
|
||||
|
||||
<?php
|
||||
// Static page is rendered as if outage started. It is never rendered as admin or preview mode.
|
||||
echo renderer::get()->render_warningbar($viewbag['outage'], $viewbag['outage']->starttime, false, false);
|
||||
echo renderer::get()->render_warningbar($viewbag['outage'], $viewbag['outage']->starttime, true, false);
|
||||
?>
|
||||
|
||||
<header>
|
||||
|
||||
Reference in New Issue
Block a user