[WIP]PR#19 ( renderOptionPageTemplate ) #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This PR adds a unit and integration test for the function
render_option_page_template()in theextend-give-wpplugin. The callback is the 6th parameter passed toadd_submenu_page()within the functionadd_option_settings_page(). The function under test outputs the plugin's option page template in the WordPress admin at:/wp-admin/options-general.php?page=extend-give-wp.The relative file path within the plugin to the function under test is:
Issues -- Integration Test
The assertion (
assertEquals()) within the integration test method fails.The function under test is invoked from within the function
add_option_settings_page()when theadmin_menuaction event files.While building the integration test method, I inspected the value of
(has_filter( ‘admin_menu’, ‘spiralWebDb\ExtendGiveWP\Admin\add_option_settings_page’). It returns the priority level of the callback registered to the event.I called
do_action( ‘admin_menu’, ‘’ );within the test method, with the intent of invokingadd_option_settings_page(), and then invokingrender_option_page_template(). I then ranrender_option_page_template()through the output buffer to return the actual view from the buffer. The buffer returned falsey ( empty string ).At present, the integration test is work-in-progress [WIP].