From 6350d9033992d1ddf16a0a4ef62673f5425c6e43 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 9 Oct 2015 04:34:29 +0000 Subject: [PATCH] Tests: Add basic DocBlocks for four helper methods in general/template.php used to assist testing the Site Icon feature. All four helpers were introduced in the feature merge for 4.3. See #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@34983 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/general/template.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php index a36bc7e417..f935a1b121 100644 --- a/tests/phpunit/tests/general/template.php +++ b/tests/phpunit/tests/general/template.php @@ -106,12 +106,25 @@ class Tests_General_Template extends WP_UnitTestCase { $this->_remove_site_icon(); } + /** + * Builds and retrieves a custom site icon meta tag. + * + * @since 4.3.0 + * + * @param $meta_tags + * @return array + */ function _custom_site_icon_meta_tag( $meta_tags ) { $meta_tags[] = sprintf( '', esc_url( get_site_icon_url( 150 ) ) ); return $meta_tags; } + /** + * Sets a site icon in options for testing. + * + * @since 4.3.0 + */ function _set_site_icon() { if ( ! $this->site_icon_id ) { add_filter( 'intermediate_image_sizes_advanced', array( $this->wp_site_icon, 'additional_sizes' ) ); @@ -122,10 +135,20 @@ class Tests_General_Template extends WP_UnitTestCase { update_option( 'site_icon', $this->site_icon_id ); } + /** + * Removes the site icon from options. + * + * @since 4.3.0 + */ function _remove_site_icon() { delete_option( 'site_icon' ); } + /** + * Inserts an attachment for testing site icons. + * + * @since 4.3.0 + */ function _insert_attachment() { $filename = DIR_TESTDATA . '/images/test-image.jpg'; $contents = file_get_contents( $filename );