-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test coverage for AMP_Theme_Support #1034
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ce66658
Fix phpunit warnings regarding use of @cover fornon-existing class or…
westonruter 1fe5527
Add stubs for missing tests; re-order tests to mirror order in theme …
westonruter 7232ab5
Remove needless amp prefix from set_comments_walker method
westonruter b3c6402
Add test for AMP_Theme_Support::set_comments_walker()
westonruter 97dcdf1
Skip printing paths-scope because it causes push builds to be truncat…
westonruter 4c17c67
Add 2 PHPUnit tests for AMP_Theme_Support.
4d70aa9
Test 2 more methods in AMP_Theme_Support.
ac6cac1
Test 3 more methods in AMP_Theme_Support.
92ada3b
Test 3 more methods in AMP_Theme_Support.
93bf043
Add comment form-related PHPUnit tests.
7c704ae
Remove the conditional around the add_action for preview scripts.
f90c40a
Remove test for renamed method, as test already exists.
DavidCramer 912ea33
Test start and finish output buffers.
DavidCramer e4dedbb
Add test for partial render and flesh out buffer tests.
DavidCramer ce68491
Correct assertion on has_action for shutdown
DavidCramer 9caf29b
use function_exists instead of extension_loaded to simplify testing.
DavidCramer cdb6bba
define newrelic_disable_autorum to allow testing
DavidCramer 1b75fae
more coverage for intercept_post_request_redirect
DavidCramer 2540e86
Remove extra variable declarations.
86f13fb
Remove extra phpcs:ignore comments.
b365e00
Address issues from CR
DavidCramer 9e87ea6
Merge in 0.7, resolve conflicts.
71b83fc
Fix a failed unit test by setting $wp_styles to null.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,9 +225,7 @@ public static function add_hooks() { | |
add_action( 'wp_head', 'amp_add_generator_metadata', 20 ); | ||
|
||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) ); | ||
if ( is_customize_preview() ) { | ||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 ); | ||
} | ||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 ); | ||
add_filter( 'customize_partial_render', array( __CLASS__, 'filter_customize_partial_render' ) ); | ||
|
||
add_action( 'wp_footer', 'amp_print_analytics' ); | ||
|
@@ -245,7 +243,7 @@ public static function add_hooks() { | |
add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), 0 ); | ||
|
||
// Commenting hooks. | ||
add_filter( 'wp_list_comments_args', array( __CLASS__, 'amp_set_comments_walker' ), PHP_INT_MAX ); | ||
add_filter( 'wp_list_comments_args', array( __CLASS__, 'set_comments_walker' ), PHP_INT_MAX ); | ||
add_filter( 'comment_form_defaults', array( __CLASS__, 'filter_comment_form_defaults' ) ); | ||
add_filter( 'comment_reply_link', array( __CLASS__, 'filter_comment_reply_link' ), 10, 4 ); | ||
add_filter( 'cancel_comment_reply_link', array( __CLASS__, 'filter_cancel_comment_reply_link' ), 10, 3 ); | ||
|
@@ -631,7 +629,7 @@ public static function register_content_embed_handlers() { | |
* @param array $args the args for the comments list.. | ||
* @return array Args to return. | ||
*/ | ||
public static function amp_set_comments_walker( $args ) { | ||
public static function set_comments_walker( $args ) { | ||
$amp_walker = new AMP_Comment_Walker(); | ||
$args['walker'] = $amp_walker; | ||
// Add reverse order here as well, in case theme overrides it. | ||
|
@@ -983,7 +981,7 @@ public static function start_output_buffering() { | |
* Sites with New Relic will need to specially configure New Relic for AMP: | ||
* https://docs.newrelic.com/docs/browser/new-relic-browser/installation/monitor-amp-pages-new-relic-browser | ||
*/ | ||
if ( extension_loaded( 'newrelic' ) ) { | ||
if ( function_exists( 'newrelic_disable_autorum' ) ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea to make testing easier. |
||
newrelic_disable_autorum(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this method's name is now different from that in the add_action() call: