Opened 8 years ago
Closed 8 years ago
#33752 closed enhancement (invalid)
Allow plugin admin page to skip including admin-footer.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | administration | Cc: |
Description
I think this helps using unit test for plugins.
Attachments (1)
Change History (4)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
8 years ago
- Keywords reporter-feedback removed
Replying to johnbillion:
Thanks for the ticket, extendwings.
Can you provide some more information about why this is useful? How are your unit tests running and what are they doing that means that the admin footer causes problems?
In my plugin, I'm using noheader
(url query) and exit
to output XML data.
But in unit test, exit
aborts PHPUnit, unexpectedly.
With nofooter
, I don't need to use exit
and it is easy to use PHPUnit.
#3
in reply to:
↑ 2
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Replying to extendwings:
In my plugin, I'm using
noheader
(url query) andexit
to output XML data.
But in unit test,exit
aborts PHPUnit, unexpectedly.
Thanks for the info. Have you tested your patch? The AJAX handler in WordPress doesn't output the admin footer (for obvious reasons), so adding a conditional there would not affect your plugin.
Instead, you should split your plugin's show_twiml_page()
method into two. One which handles the AJAX processing and one which generates and returns the TwiML. Then you can test the TwiML generation in your unit test, and test the AJAX request and response in an integration test.
Thanks for the ticket, extendwings.
Can you provide some more information about why this is useful? How are your unit tests running and what are they doing that means that the admin footer causes problems?