From f2c8c10eb5ef7c9bb9707c4787b65f31c8b56292 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 11 Sep 2021 18:43:53 +0200 Subject: Change how we load the plugin. Since we now have code that should be available, both on the public blog and in the admin section, we need to be more graular when loading the various parts of the plugin. We still try to avoid loading admin-only parts for the public blog, but allways load the parts that we need in either case. Also avoid running the db migrations when running unit tests, as the schema is copied over from the dev environment it just caues problems. Finally, don't hardcode unit tests to always be in_admin, but rather determine that for each test. --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/bootstrap.php') diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c999ba1..798322a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -30,7 +30,7 @@ require_once $_tests_dir . '/includes/functions.php'; * Manually load the plugin being tested. */ function _manually_load_plugin() { - define('WP_ADMIN', true); // We're always in admin + define('GIGLOGADMIN_UNIT_TEST', true); require dirname( dirname( __FILE__ ) ) . '/giglogadmin.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); -- cgit v1.2.3