Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/04/2018 09:35:46 PM (8 years ago)
Author:
r-a-y
Message:

Unit Tests: Run 'bp_template_redirect' hook in go_to() method.

In PHPUnit, we mock page visits with the go_to() method, however we
previously only ran the 'bp_init' hook, which sets up various internal
page routing properties, but doesn't run any screen hooks.

This commit adds the 'bp_template_redirect' hook to the go_to() method,
which allows hooks like 'bp_actions' and 'bp_screens' to run. In order
for those hooks to run without errors in PHPUnit, we need to adjust our
bp_core_redirect() function so it doesn't kill execution. Also, for
PHPUnit, we do not allow redirects to occur since they cause 'headers
already sent' notices.

Lastly, we can adjust some unit tests to just use the go_to() method,
instead of needing to manually call a screen hook.

Fixes #7703.

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.