From ffb9e27456a055dbde9e479c9fd60226f3cea473 Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Wed, 26 Feb 2025 16:40:41 +1300 Subject: [PATCH 1/4] add tearDown method to runtests --- tests/dml/installation_test.php | 5 +++++ tests/dml/outagedb_test.php | 5 +++++ tests/form/outage/forms_test.php | 5 +++++ tests/local/cli/cli_test.php | 5 +++++ tests/local/cli/cli_testcase.php | 5 +++++ tests/local/cli/create_test.php | 5 +++++ tests/local/cli/finish_test.php | 5 +++++ tests/local/cli/waitforit_test.php | 5 +++++ tests/local/controllers/infopage_test.php | 5 +++++ tests/local/controllers/maintenance_static_page_test.php | 5 +++++ tests/local/outage_test.php | 5 +++++ tests/local/outagelib_test.php | 5 +++++ 12 files changed, 60 insertions(+) diff --git a/tests/dml/installation_test.php b/tests/dml/installation_test.php index bd28a40..8646788 100644 --- a/tests/dml/installation_test.php +++ b/tests/dml/installation_test.php @@ -44,6 +44,11 @@ require_once(__DIR__.'/../base_testcase.php'); * @covers \auth_outage\dml\outagedb */ class installation_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Checks if plugin cleans up data after uninstall. * diff --git a/tests/dml/outagedb_test.php b/tests/dml/outagedb_test.php index 07b4a01..31c4d59 100644 --- a/tests/dml/outagedb_test.php +++ b/tests/dml/outagedb_test.php @@ -40,6 +40,11 @@ require_once(__DIR__.'/../base_testcase.php'); * @covers \auth_outage\dml\outagedb */ class outagedb_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Creates an array of ids in from the given outages array. * @param outage[] $outages An array of outages. diff --git a/tests/form/outage/forms_test.php b/tests/form/outage/forms_test.php index 0f28f55..250475a 100644 --- a/tests/form/outage/forms_test.php +++ b/tests/form/outage/forms_test.php @@ -40,6 +40,11 @@ require_once(__DIR__.'/../../base_testcase.php'); * @covers \auth_outage\form\outage\edit */ class forms_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Create a delete form. */ diff --git a/tests/local/cli/cli_test.php b/tests/local/cli/cli_test.php index 87b172d..6fedc4f 100644 --- a/tests/local/cli/cli_test.php +++ b/tests/local/cli/cli_test.php @@ -38,6 +38,11 @@ require_once(__DIR__.'/cli_testcase.php'); * @covers \auth_outage\local\cli\create */ class cli_test extends cli_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests providing an unknown parameter. */ diff --git a/tests/local/cli/cli_testcase.php b/tests/local/cli/cli_testcase.php index b39a601..9b6c669 100644 --- a/tests/local/cli/cli_testcase.php +++ b/tests/local/cli/cli_testcase.php @@ -37,6 +37,11 @@ require_once(__DIR__.'/../../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class cli_testcase extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Always enable the auth outage plugin, resets after test and set no parameters. */ diff --git a/tests/local/cli/create_test.php b/tests/local/cli/create_test.php index ec5b548..9e5f8be 100644 --- a/tests/local/cli/create_test.php +++ b/tests/local/cli/create_test.php @@ -41,6 +41,11 @@ require_once(__DIR__.'/cli_testcase.php'); * @covers \auth_outage\local\cli\create */ class create_test extends cli_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests without any arguments. */ diff --git a/tests/local/cli/finish_test.php b/tests/local/cli/finish_test.php index 163a28b..c8fbf8a 100644 --- a/tests/local/cli/finish_test.php +++ b/tests/local/cli/finish_test.php @@ -41,6 +41,11 @@ require_once(__DIR__.'/cli_testcase.php'); * @covers \auth_outage\local\cli\finish */ class finish_test extends cli_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests the constructor. */ diff --git a/tests/local/cli/waitforit_test.php b/tests/local/cli/waitforit_test.php index db596e9..7a3e74b 100644 --- a/tests/local/cli/waitforit_test.php +++ b/tests/local/cli/waitforit_test.php @@ -41,6 +41,11 @@ require_once(__DIR__.'/cli_testcase.php'); * @covers \auth_outage\local\cli\waitforit */ class waitforit_test extends cli_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests the constructor. */ diff --git a/tests/local/controllers/infopage_test.php b/tests/local/controllers/infopage_test.php index 3cd582d..18aeecc 100644 --- a/tests/local/controllers/infopage_test.php +++ b/tests/local/controllers/infopage_test.php @@ -41,6 +41,11 @@ require_once(__DIR__.'/../../base_testcase.php'); * @covers \auth_outage\local\controllers\infopage */ class infopage_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests the constructor. */ diff --git a/tests/local/controllers/maintenance_static_page_test.php b/tests/local/controllers/maintenance_static_page_test.php index 29f79df..aa554e4 100644 --- a/tests/local/controllers/maintenance_static_page_test.php +++ b/tests/local/controllers/maintenance_static_page_test.php @@ -41,6 +41,11 @@ require_once(__DIR__.'/../../base_testcase.php'); * @covers \auth_outage\local\controllers\maintenance_static_page_generator */ class maintenance_static_page_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Test template file. */ diff --git a/tests/local/outage_test.php b/tests/local/outage_test.php index 4bf5831..ddb6376 100644 --- a/tests/local/outage_test.php +++ b/tests/local/outage_test.php @@ -29,6 +29,11 @@ require_once(__DIR__.'/../base_testcase.php'); * @covers \auth_outage\local\outage */ class outage_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Tests the constructor. */ diff --git a/tests/local/outagelib_test.php b/tests/local/outagelib_test.php index 73b536b..01f1ebb 100644 --- a/tests/local/outagelib_test.php +++ b/tests/local/outagelib_test.php @@ -33,6 +33,11 @@ require_once(__DIR__.'/../base_testcase.php'); * @covers \auth_outage\local\outagelib */ class outagelib_test extends \auth_outage\base_testcase { + + public function tearDown(): void { + parent::tearDown(); + } + /** * Check if maintenance message is disabled as needed. */ From cff0f3fbe3d83fede8139ac7060629da2b64d726 Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Thu, 27 Feb 2025 08:59:31 +1300 Subject: [PATCH 2/4] update test classes --- tests/dml/events_test.php | 2 +- tests/lib_test.php | 2 +- tests/local/cli/create_test.php | 2 +- tests/local/cli/finish_test.php | 2 +- tests/local/cli/waitforit_test.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/dml/events_test.php b/tests/dml/events_test.php index c9f66df..c65d144 100644 --- a/tests/dml/events_test.php +++ b/tests/dml/events_test.php @@ -39,7 +39,7 @@ use auth_outage\local\outage; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\dml\outagedb */ -class events_test extends \core_phpunit\testcase { +class dml_events_test extends \core_phpunit\testcase { /** * @var outage|null Outage used in the tests. */ diff --git a/tests/lib_test.php b/tests/lib_test.php index ec53cbe..0c08a25 100644 --- a/tests/lib_test.php +++ b/tests/lib_test.php @@ -29,7 +29,7 @@ require_once(__DIR__.'/../lib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers ::auth_outage_get_climaintenance_resource_file */ -class lib_test extends base_testcase { +class lib_test extends \core_phpunit\testcase { /** * Test this plugin gets climaintenance resource file. */ diff --git a/tests/local/cli/create_test.php b/tests/local/cli/create_test.php index 9e5f8be..6b94a21 100644 --- a/tests/local/cli/create_test.php +++ b/tests/local/cli/create_test.php @@ -40,7 +40,7 @@ require_once(__DIR__.'/cli_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\cli\create */ -class create_test extends cli_testcase { +class cli_create_test extends cli_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/cli/finish_test.php b/tests/local/cli/finish_test.php index c8fbf8a..48c2443 100644 --- a/tests/local/cli/finish_test.php +++ b/tests/local/cli/finish_test.php @@ -40,7 +40,7 @@ require_once(__DIR__.'/cli_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\cli\finish */ -class finish_test extends cli_testcase { +class cli_finish_test extends cli_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/cli/waitforit_test.php b/tests/local/cli/waitforit_test.php index 7a3e74b..0197bfe 100644 --- a/tests/local/cli/waitforit_test.php +++ b/tests/local/cli/waitforit_test.php @@ -40,7 +40,7 @@ require_once(__DIR__.'/cli_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\cli\waitforit */ -class waitforit_test extends cli_testcase { +class cli_waitforit_test extends cli_testcase { public function tearDown(): void { parent::tearDown(); From eac1575f5131e36ff1aa134e2e495c3a356d484b Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Thu, 27 Feb 2025 09:09:06 +1300 Subject: [PATCH 3/4] use imports instead of namespaces --- tests/base_testcase.php | 2 -- tests/calendar/calendar_test.php | 3 +-- tests/dml/events_test.php | 3 +-- tests/dml/installation_test.php | 3 +-- tests/dml/outagedb_test.php | 3 +-- tests/form/outage/forms_test.php | 5 +++-- tests/lib_test.php | 2 -- tests/local/cli/cli_test.php | 3 ++- tests/local/cli/cli_testcase.php | 4 +--- tests/local/cli/create_test.php | 4 ++-- tests/local/cli/finish_test.php | 4 ++-- tests/local/cli/waitforit_test.php | 4 ++-- tests/local/controllers/infopage_test.php | 3 +-- tests/local/controllers/maintenance_static_page_test.php | 5 +++-- tests/local/outage_test.php | 2 +- tests/local/outagelib_test.php | 4 ++-- 16 files changed, 23 insertions(+), 31 deletions(-) diff --git a/tests/base_testcase.php b/tests/base_testcase.php index cc79c0d..1976ad2 100644 --- a/tests/base_testcase.php +++ b/tests/base_testcase.php @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace auth_outage; - use auth_outage\dml\outagedb; use auth_outage\local\outage; diff --git a/tests/calendar/calendar_test.php b/tests/calendar/calendar_test.php index bc55123..74afa73 100644 --- a/tests/calendar/calendar_test.php +++ b/tests/calendar/calendar_test.php @@ -23,9 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\calendar; - use auth_outage\local\outage; +use auth_outage\calendar\calendar; /** * calendar_test test class. diff --git a/tests/dml/events_test.php b/tests/dml/events_test.php index c65d144..f810353 100644 --- a/tests/dml/events_test.php +++ b/tests/dml/events_test.php @@ -23,9 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\dml; - use auth_outage\local\outage; +use auth_outage\dml\outagedb; /** * events_test tests class. diff --git a/tests/dml/installation_test.php b/tests/dml/installation_test.php index 8646788..fecad0f 100644 --- a/tests/dml/installation_test.php +++ b/tests/dml/installation_test.php @@ -25,9 +25,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\dml; - use auth_outage\local\outage; +use auth_outage\dml\outagedb; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../base_testcase.php'); diff --git a/tests/dml/outagedb_test.php b/tests/dml/outagedb_test.php index 31c4d59..df60cbc 100644 --- a/tests/dml/outagedb_test.php +++ b/tests/dml/outagedb_test.php @@ -23,9 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\dml; - use auth_outage\local\outage; +use auth_outage\dml\outagedb; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../base_testcase.php'); diff --git a/tests/form/outage/forms_test.php b/tests/form/outage/forms_test.php index 250475a..f7ed590 100644 --- a/tests/form/outage/forms_test.php +++ b/tests/form/outage/forms_test.php @@ -23,9 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\form\outage; - use auth_outage\local\outage; +use auth_outage\form\outage\delete; +use auth_outage\form\outage\finish; +use auth_outage\form\outage\edit; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../../base_testcase.php'); diff --git a/tests/lib_test.php b/tests/lib_test.php index 0c08a25..286f34c 100644 --- a/tests/lib_test.php +++ b/tests/lib_test.php @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace auth_outage; - defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/base_testcase.php'); require_once(__DIR__.'/../lib.php'); diff --git a/tests/local/cli/cli_test.php b/tests/local/cli/cli_test.php index 6fedc4f..d821e74 100644 --- a/tests/local/cli/cli_test.php +++ b/tests/local/cli/cli_test.php @@ -23,7 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\cli; +use auth_outage\local\cli\cli_exception; +use auth_outage\local\cli\create; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/cli_testcase.php'); diff --git a/tests/local/cli/cli_testcase.php b/tests/local/cli/cli_testcase.php index 9b6c669..e9cec6f 100644 --- a/tests/local/cli/cli_testcase.php +++ b/tests/local/cli/cli_testcase.php @@ -23,8 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\cli; - defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../../base_testcase.php'); @@ -78,7 +76,7 @@ abstract class cli_testcase extends \auth_outage\base_testcase { * * @return string The output text. */ - protected function execute(clibase $cli) { + protected function execute(mixed $cli) { ob_start(); try { $cli->execute(); diff --git a/tests/local/cli/create_test.php b/tests/local/cli/create_test.php index 6b94a21..aefeff4 100644 --- a/tests/local/cli/create_test.php +++ b/tests/local/cli/create_test.php @@ -23,10 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\cli; - use auth_outage\dml\outagedb; use auth_outage\local\outage; +use auth_outage\local\cli\create; +use auth_outage\local\cli\cli_exception; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/cli_testcase.php'); diff --git a/tests/local/cli/finish_test.php b/tests/local/cli/finish_test.php index 48c2443..e872d85 100644 --- a/tests/local/cli/finish_test.php +++ b/tests/local/cli/finish_test.php @@ -23,10 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\cli; - use auth_outage\dml\outagedb; use auth_outage\local\outage; +use auth_outage\local\cli\finish; +use auth_outage\local\cli\cli_exception; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/cli_testcase.php'); diff --git a/tests/local/cli/waitforit_test.php b/tests/local/cli/waitforit_test.php index 0197bfe..fd9c354 100644 --- a/tests/local/cli/waitforit_test.php +++ b/tests/local/cli/waitforit_test.php @@ -23,10 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\cli; - use auth_outage\dml\outagedb; use auth_outage\local\outage; +use auth_outage\local\cli\waitforit; +use auth_outage\local\cli\cli_exception; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/cli_testcase.php'); diff --git a/tests/local/controllers/infopage_test.php b/tests/local/controllers/infopage_test.php index 18aeecc..680e682 100644 --- a/tests/local/controllers/infopage_test.php +++ b/tests/local/controllers/infopage_test.php @@ -23,9 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\controllers; - use auth_outage\local\outage; +use auth_outage\local\controllers\infopage; use context_system; defined('MOODLE_INTERNAL') || die(); diff --git a/tests/local/controllers/maintenance_static_page_test.php b/tests/local/controllers/maintenance_static_page_test.php index aa554e4..9007022 100644 --- a/tests/local/controllers/maintenance_static_page_test.php +++ b/tests/local/controllers/maintenance_static_page_test.php @@ -23,9 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace auth_outage\local\controllers; - use auth_outage\task\update_static_page; +use auth_outage\local\controllers\maintenance_static_page; +use auth_outage\local\controllers\maintenance_static_page_io; +use auth_outage\local\controllers\maintenance_static_page_generator; use DOMDocument; defined('MOODLE_INTERNAL') || die(); diff --git a/tests/local/outage_test.php b/tests/local/outage_test.php index ddb6376..afde837 100644 --- a/tests/local/outage_test.php +++ b/tests/local/outage_test.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace auth_outage\local; +use auth_outage\local\outage; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../base_testcase.php'); diff --git a/tests/local/outagelib_test.php b/tests/local/outagelib_test.php index 01f1ebb..3d5b3c5 100644 --- a/tests/local/outagelib_test.php +++ b/tests/local/outagelib_test.php @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace auth_outage\local; - use auth_outage\dml\outagedb; +use auth_outage\local\outage; +use auth_outage\local\outagelib; defined('MOODLE_INTERNAL') || die(); global $CFG; From ca213e4c04310450075dadbee993b1ee8ba63f19 Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Thu, 27 Feb 2025 10:17:25 +1300 Subject: [PATCH 4/4] flatten test directory structure --- tests/{calendar => }/calendar_test.php | 0 .../cli/create_test.php => cli_create_test.php} | 0 .../cli/finish_test.php => cli_finish_test.php} | 0 tests/{local/cli => }/cli_test.php | 0 tests/{local/cli => }/cli_testcase.php | 4 ++-- .../waitforit_test.php => cli_waitforit_test.php} | 0 ...opage_test.php => controllers_infopage_test.php} | 4 ++-- ...=> controllers_maintenance_static_page_test.php} | 10 +++++----- tests/{dml/events_test.php => dml_events_test.php} | 0 ...tallation_test.php => dml_installation_test.php} | 4 ++-- .../outagedb_test.php => dml_outagedb_test.php} | 4 ++-- tests/{local/controllers => }/fixtures/catalyst.png | Bin tests/{local/controllers => }/fixtures/simple.css | 0 .../fixtures/subdir/withurls-subdir.css | 0 .../controllers => }/fixtures/withurls-quoted.css | 0 tests/{local/controllers => }/fixtures/withurls.css | 0 tests/{form/outage => }/forms_test.php | 4 ++-- tests/{local => }/outage_test.php | 4 ++-- tests/{local => }/outagelib_test.php | 4 ++-- 19 files changed, 19 insertions(+), 19 deletions(-) rename tests/{calendar => }/calendar_test.php (100%) rename tests/{local/cli/create_test.php => cli_create_test.php} (100%) rename tests/{local/cli/finish_test.php => cli_finish_test.php} (100%) rename tests/{local/cli => }/cli_test.php (100%) rename tests/{local/cli => }/cli_testcase.php (96%) rename tests/{local/cli/waitforit_test.php => cli_waitforit_test.php} (100%) rename tests/{local/controllers/infopage_test.php => controllers_infopage_test.php} (98%) rename tests/{local/controllers/maintenance_static_page_test.php => controllers_maintenance_static_page_test.php} (98%) rename tests/{dml/events_test.php => dml_events_test.php} (100%) rename tests/{dml/installation_test.php => dml_installation_test.php} (97%) rename tests/{dml/outagedb_test.php => dml_outagedb_test.php} (99%) rename tests/{local/controllers => }/fixtures/catalyst.png (100%) rename tests/{local/controllers => }/fixtures/simple.css (100%) rename tests/{local/controllers => }/fixtures/subdir/withurls-subdir.css (100%) rename tests/{local/controllers => }/fixtures/withurls-quoted.css (100%) rename tests/{local/controllers => }/fixtures/withurls.css (100%) rename tests/{form/outage => }/forms_test.php (98%) rename tests/{local => }/outage_test.php (99%) rename tests/{local => }/outagelib_test.php (99%) diff --git a/tests/calendar/calendar_test.php b/tests/calendar_test.php similarity index 100% rename from tests/calendar/calendar_test.php rename to tests/calendar_test.php diff --git a/tests/local/cli/create_test.php b/tests/cli_create_test.php similarity index 100% rename from tests/local/cli/create_test.php rename to tests/cli_create_test.php diff --git a/tests/local/cli/finish_test.php b/tests/cli_finish_test.php similarity index 100% rename from tests/local/cli/finish_test.php rename to tests/cli_finish_test.php diff --git a/tests/local/cli/cli_test.php b/tests/cli_test.php similarity index 100% rename from tests/local/cli/cli_test.php rename to tests/cli_test.php diff --git a/tests/local/cli/cli_testcase.php b/tests/cli_testcase.php similarity index 96% rename from tests/local/cli/cli_testcase.php rename to tests/cli_testcase.php index e9cec6f..c449293 100644 --- a/tests/local/cli/cli_testcase.php +++ b/tests/cli_testcase.php @@ -24,7 +24,7 @@ */ defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * cli_testcase class. @@ -34,7 +34,7 @@ require_once(__DIR__.'/../../base_testcase.php'); * @copyright 2016 Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -abstract class cli_testcase extends \auth_outage\base_testcase { +abstract class cli_testcase extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/cli/waitforit_test.php b/tests/cli_waitforit_test.php similarity index 100% rename from tests/local/cli/waitforit_test.php rename to tests/cli_waitforit_test.php diff --git a/tests/local/controllers/infopage_test.php b/tests/controllers_infopage_test.php similarity index 98% rename from tests/local/controllers/infopage_test.php rename to tests/controllers_infopage_test.php index 680e682..d78e6ce 100644 --- a/tests/local/controllers/infopage_test.php +++ b/tests/controllers_infopage_test.php @@ -28,7 +28,7 @@ use auth_outage\local\controllers\infopage; use context_system; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * Tests performed on infopage controller class and update_static_page task class. @@ -39,7 +39,7 @@ require_once(__DIR__.'/../../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\controllers\infopage */ -class infopage_test extends \auth_outage\base_testcase { +class controllers_infopage_test extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/controllers/maintenance_static_page_test.php b/tests/controllers_maintenance_static_page_test.php similarity index 98% rename from tests/local/controllers/maintenance_static_page_test.php rename to tests/controllers_maintenance_static_page_test.php index 9007022..3c142f8 100644 --- a/tests/local/controllers/maintenance_static_page_test.php +++ b/tests/controllers_maintenance_static_page_test.php @@ -30,7 +30,7 @@ use auth_outage\local\controllers\maintenance_static_page_generator; use DOMDocument; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * maintenance_static_page_test class. @@ -41,7 +41,7 @@ require_once(__DIR__.'/../../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\controllers\maintenance_static_page_generator */ -class maintenance_static_page_test extends \auth_outage\base_testcase { +class controllers_maintenance_static_page_test extends base_testcase { public function tearDown(): void { parent::tearDown(); @@ -128,7 +128,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase { $page->generate(); // Check for css file. - self::assertFileExists($page->get_io()->get_resources_folder().'/53365950336b070c0b26ca50e7d0dad962c364e6.dGV4dC9wbGFpbg'); + self::assertFileExists($page->get_io()->get_resources_folder().'/b09bd4b66cc3964d5fc5978752fc554f5666daa3.dGV4dC9wbGFpbg'); // Check for catalyst.png file referenced in url(..) of css. self::assertFileExists($page->get_io()->get_resources_folder().'/ff7f7f87a26a908fc72930eaefb6b57306361d16.aW1hZ2UvcG5n'); @@ -146,7 +146,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase { $page->generate(); // Check for css file. - self::assertFileExists($page->get_io()->get_resources_folder().'/e0b34925c1f939c247a4b50d6bf08c76088def39.dGV4dC9wbGFpbg'); + self::assertFileExists($page->get_io()->get_resources_folder().'/2ec04228cc8bb37782f511aaeb01ee553cc884a4.dGV4dC9wbGFpbg'); // Check for catalyst.png file referenced in url(..) of css. self::assertFileExists($page->get_io()->get_resources_folder().'/ff7f7f87a26a908fc72930eaefb6b57306361d16.aW1hZ2UvcG5n'); @@ -344,7 +344,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase { * @return string */ private function get_fixture_path_location($file) { - return (string)new \moodle_url('/auth/outage/tests/local/controllers/fixtures/'.$file); + return (string)new \moodle_url('/auth/outage/tests/fixtures/'.$file); } /** diff --git a/tests/dml/events_test.php b/tests/dml_events_test.php similarity index 100% rename from tests/dml/events_test.php rename to tests/dml_events_test.php diff --git a/tests/dml/installation_test.php b/tests/dml_installation_test.php similarity index 97% rename from tests/dml/installation_test.php rename to tests/dml_installation_test.php index fecad0f..2f0b02e 100644 --- a/tests/dml/installation_test.php +++ b/tests/dml_installation_test.php @@ -29,7 +29,7 @@ use auth_outage\local\outage; use auth_outage\dml\outagedb; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * installation_test test class. @@ -42,7 +42,7 @@ require_once(__DIR__.'/../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\dml\outagedb */ -class installation_test extends \auth_outage\base_testcase { +class dml_installation_test extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/dml/outagedb_test.php b/tests/dml_outagedb_test.php similarity index 99% rename from tests/dml/outagedb_test.php rename to tests/dml_outagedb_test.php index df60cbc..55dea89 100644 --- a/tests/dml/outagedb_test.php +++ b/tests/dml_outagedb_test.php @@ -27,7 +27,7 @@ use auth_outage\local\outage; use auth_outage\dml\outagedb; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * outagedb_test tests class. @@ -38,7 +38,7 @@ require_once(__DIR__.'/../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\dml\outagedb */ -class outagedb_test extends \auth_outage\base_testcase { +class dml_outagedb_test extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/controllers/fixtures/catalyst.png b/tests/fixtures/catalyst.png similarity index 100% rename from tests/local/controllers/fixtures/catalyst.png rename to tests/fixtures/catalyst.png diff --git a/tests/local/controllers/fixtures/simple.css b/tests/fixtures/simple.css similarity index 100% rename from tests/local/controllers/fixtures/simple.css rename to tests/fixtures/simple.css diff --git a/tests/local/controllers/fixtures/subdir/withurls-subdir.css b/tests/fixtures/subdir/withurls-subdir.css similarity index 100% rename from tests/local/controllers/fixtures/subdir/withurls-subdir.css rename to tests/fixtures/subdir/withurls-subdir.css diff --git a/tests/local/controllers/fixtures/withurls-quoted.css b/tests/fixtures/withurls-quoted.css similarity index 100% rename from tests/local/controllers/fixtures/withurls-quoted.css rename to tests/fixtures/withurls-quoted.css diff --git a/tests/local/controllers/fixtures/withurls.css b/tests/fixtures/withurls.css similarity index 100% rename from tests/local/controllers/fixtures/withurls.css rename to tests/fixtures/withurls.css diff --git a/tests/form/outage/forms_test.php b/tests/forms_test.php similarity index 98% rename from tests/form/outage/forms_test.php rename to tests/forms_test.php index f7ed590..de5c569 100644 --- a/tests/form/outage/forms_test.php +++ b/tests/forms_test.php @@ -29,7 +29,7 @@ use auth_outage\form\outage\finish; use auth_outage\form\outage\edit; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * forms_test test class. @@ -40,7 +40,7 @@ require_once(__DIR__.'/../../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\form\outage\edit */ -class forms_test extends \auth_outage\base_testcase { +class forms_test extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/outage_test.php b/tests/outage_test.php similarity index 99% rename from tests/local/outage_test.php rename to tests/outage_test.php index afde837..9c06b6d 100644 --- a/tests/local/outage_test.php +++ b/tests/outage_test.php @@ -17,7 +17,7 @@ use auth_outage\local\outage; defined('MOODLE_INTERNAL') || die(); -require_once(__DIR__.'/../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * outage_test test class. @@ -28,7 +28,7 @@ require_once(__DIR__.'/../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\outage */ -class outage_test extends \auth_outage\base_testcase { +class outage_test extends base_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/local/outagelib_test.php b/tests/outagelib_test.php similarity index 99% rename from tests/local/outagelib_test.php rename to tests/outagelib_test.php index 3d5b3c5..e41efa0 100644 --- a/tests/local/outagelib_test.php +++ b/tests/outagelib_test.php @@ -21,7 +21,7 @@ use auth_outage\local\outagelib; defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir.'/adminlib.php'); -require_once(__DIR__.'/../base_testcase.php'); +require_once(__DIR__.'/base_testcase.php'); /** * outagelib_test test class. @@ -32,7 +32,7 @@ require_once(__DIR__.'/../base_testcase.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \auth_outage\local\outagelib */ -class outagelib_test extends \auth_outage\base_testcase { +class outagelib_test extends base_testcase { public function tearDown(): void { parent::tearDown();