Open schlessera opened 4 years ago
We could also just empty out the $wp_actions
array.
That won't have the same effect, as the actions will already have run and modified all the globals. If we want to catch timing issues, we have to run the tests with the real setup. otherwise we're testing something irrelevant and meaningless.
Feature description
We don't have an obvious way right now to test anything that happens before the
'wp'
hook, as we're using theWP_UnitTestCase
. This leads to issues like the https://github.com/ampproject/amp-wp/issues/4525 because we can never catch any timing problems that can happen before the'wp'
action.It might be worthwhile to set up a separate set of tests that use
SHORT_INIT
or some other hack to achieve the same thing) to be able to test our plugin against WordPress, but control which actions happen and test for earlier conflicts.This would also allow us to add regression tests to fixes like the one for the issue above, where we can only test manually right now.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
'wp'
.Implementation brief
TestCase
implementation that loads WordPress viaSHORT_INIT
.go_to_action()
method.QA testing instructions
Demo
Changelog entry