From 76d656072bfa66396226eb7c6347d4a27feb9b62 Mon Sep 17 00:00:00 2001 From: Daniel Thee Roperto Date: Mon, 26 Sep 2016 10:27:49 +1000 Subject: [PATCH] Issue #52 - Fixed static page. --- tests/phpunit.xml | 31 ------------------- tests/{ => phpunit}/cli/cli_test.php | 0 tests/{ => phpunit}/cli/cli_testcase.php | 0 tests/{ => phpunit}/cli/create_test.php | 0 tests/{ => phpunit}/cli/finish_test.php | 0 tests/{ => phpunit}/cli/waitforit_test.php | 0 tests/{ => phpunit}/events_test.php | 0 .../{ => phpunit}/infopagecontroller_test.php | 9 +++++- tests/{ => phpunit}/outage_test.php | 0 tests/{ => phpunit}/outagedb_test.php | 0 views/info/static.php | 2 +- 11 files changed, 9 insertions(+), 33 deletions(-) delete mode 100644 tests/phpunit.xml rename tests/{ => phpunit}/cli/cli_test.php (100%) rename tests/{ => phpunit}/cli/cli_testcase.php (100%) rename tests/{ => phpunit}/cli/create_test.php (100%) rename tests/{ => phpunit}/cli/finish_test.php (100%) rename tests/{ => phpunit}/cli/waitforit_test.php (100%) rename tests/{ => phpunit}/events_test.php (100%) rename tests/{ => phpunit}/infopagecontroller_test.php (90%) rename tests/{ => phpunit}/outage_test.php (100%) rename tests/{ => phpunit}/outagedb_test.php (100%) diff --git a/tests/phpunit.xml b/tests/phpunit.xml deleted file mode 100644 index 7466503..0000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./ - - - - - - ../classes - - - diff --git a/tests/cli/cli_test.php b/tests/phpunit/cli/cli_test.php similarity index 100% rename from tests/cli/cli_test.php rename to tests/phpunit/cli/cli_test.php diff --git a/tests/cli/cli_testcase.php b/tests/phpunit/cli/cli_testcase.php similarity index 100% rename from tests/cli/cli_testcase.php rename to tests/phpunit/cli/cli_testcase.php diff --git a/tests/cli/create_test.php b/tests/phpunit/cli/create_test.php similarity index 100% rename from tests/cli/create_test.php rename to tests/phpunit/cli/create_test.php diff --git a/tests/cli/finish_test.php b/tests/phpunit/cli/finish_test.php similarity index 100% rename from tests/cli/finish_test.php rename to tests/phpunit/cli/finish_test.php diff --git a/tests/cli/waitforit_test.php b/tests/phpunit/cli/waitforit_test.php similarity index 100% rename from tests/cli/waitforit_test.php rename to tests/phpunit/cli/waitforit_test.php diff --git a/tests/events_test.php b/tests/phpunit/events_test.php similarity index 100% rename from tests/events_test.php rename to tests/phpunit/events_test.php diff --git a/tests/infopagecontroller_test.php b/tests/phpunit/infopagecontroller_test.php similarity index 90% rename from tests/infopagecontroller_test.php rename to tests/phpunit/infopagecontroller_test.php index 8ed2fdb..44244b8 100644 --- a/tests/infopagecontroller_test.php +++ b/tests/phpunit/infopagecontroller_test.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); * @author Daniel Thee Roperto * @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('', $html); + self::assertContains('', $html); self::assertContains($outage->get_title(), $html); self::assertContains($outage->get_description(), $html); + // Must not find... + self::assertNotContains('id, infopage::find_outageid_from_infopage($html)); } diff --git a/tests/outage_test.php b/tests/phpunit/outage_test.php similarity index 100% rename from tests/outage_test.php rename to tests/phpunit/outage_test.php diff --git a/tests/outagedb_test.php b/tests/phpunit/outagedb_test.php similarity index 100% rename from tests/outagedb_test.php rename to tests/phpunit/outagedb_test.php diff --git a/views/info/static.php b/views/info/static.php index 8a14411..dfdcfce 100644 --- a/views/info/static.php +++ b/views/info/static.php @@ -48,7 +48,7 @@ global $SITE; render_warningbar($viewbag['outage'], $viewbag['outage']->starttime, false, false); +echo renderer::get()->render_warningbar($viewbag['outage'], $viewbag['outage']->starttime, true, false); ?>