summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-11 18:43:53 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-11 18:43:53 +0200
commitf2c8c10eb5ef7c9bb9707c4787b65f31c8b56292 (patch)
treec3148b1dbe676b84033ea1daa48a081c4bf16273 /tests
parentaefe55a70d6f6bae7825f3a1a6b61046c8ec2cc3 (diff)
downloadgigologadmin-f2c8c10eb5ef7c9bb9707c4787b65f31c8b56292.tar.gz
gigologadmin-f2c8c10eb5ef7c9bb9707c4787b65f31c8b56292.tar.bz2
gigologadmin-f2c8c10eb5ef7c9bb9707c4787b65f31c8b56292.zip
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/bootstrap.php2
1 files changed, 1 insertions, 1 deletions
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' );