diff --git a/tests/phpunit/tests/formatting/balanceTags.php b/tests/phpunit/tests/formatting/balanceTags.php index 6e40f412fb..27740878f7 100644 --- a/tests/phpunit/tests/formatting/balanceTags.php +++ b/tests/phpunit/tests/formatting/balanceTags.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::balanceTags */ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { @@ -78,7 +80,7 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { /** * These are valid custom elements but we don't support them yet. * - * @see https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name + * @see https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name */ public function unsupported_valid_tag_names() { return array( diff --git a/tests/phpunit/tests/formatting/capitalPDangit.php b/tests/phpunit/tests/formatting/capitalPDangit.php index 3e78e1a364..5dc741d372 100644 --- a/tests/phpunit/tests/formatting/capitalPDangit.php +++ b/tests/phpunit/tests/formatting/capitalPDangit.php @@ -3,6 +3,8 @@ /** * @group formatting + * + * @covers ::capital_P_dangit */ class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase { public function test_esc_attr_quotes() { diff --git a/tests/phpunit/tests/formatting/cleanPre.php b/tests/phpunit/tests/formatting/cleanPre.php index 8444ae7bd5..49d0ab9e2b 100644 --- a/tests/phpunit/tests/formatting/cleanPre.php +++ b/tests/phpunit/tests/formatting/cleanPre.php @@ -6,6 +6,8 @@ * * @group formatting * @expectedDeprecated clean_pre + * + * @covers ::clean_pre */ class Tests_Formatting_CleanPre extends WP_UnitTestCase { @@ -22,10 +24,13 @@ class Tests_Formatting_CleanPre extends WP_UnitTestCase { $this->assertSame( $res, clean_pre( $source ) ); } - // I don't think this can ever happen in production; - //
is changed to
elsewhere. Left in because - // that replacement shouldn't happen (what if you want - // HTML 4 output?). + + /** + * I don't think this can ever happen in production; + *
is changed to
elsewhere. Left in because + * that replacement shouldn't happen (what if you want + * HTML 4 output?). + */ public function test_removes_html_br() { $source = 'a b c\n
sldfj
'; $res = 'a b c\nsldfj'; diff --git a/tests/phpunit/tests/formatting/convertInvalidEntries.php b/tests/phpunit/tests/formatting/convertInvalidEntries.php index 9b243ee421..6101165191 100644 --- a/tests/phpunit/tests/formatting/convertInvalidEntries.php +++ b/tests/phpunit/tests/formatting/convertInvalidEntries.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::convert_invalid_entities */ class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase { public function test_replaces_windows1252_entities_with_unicode_ones() { @@ -19,6 +21,9 @@ class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase { $this->assertSame( $output, convert_invalid_entities( $input ) ); } + /** + * @covers ::convert_chars + */ public function test_escapes_lone_ampersands() { $this->assertSame( 'at&t', convert_chars( 'at&t' ) ); } diff --git a/tests/phpunit/tests/formatting/convertSmilies.php b/tests/phpunit/tests/formatting/convertSmilies.php index 760625e40a..ce17bbf177 100644 --- a/tests/phpunit/tests/formatting/convertSmilies.php +++ b/tests/phpunit/tests/formatting/convertSmilies.php @@ -3,6 +3,8 @@ /** * @group formatting * @group emoji + * + * @covers ::convert_smilies */ class Tests_Formatting_ConvertSmilies extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/date.php b/tests/phpunit/tests/formatting/date.php index 9f0f975d4c..32e68d8f1a 100644 --- a/tests/phpunit/tests/formatting/date.php +++ b/tests/phpunit/tests/formatting/date.php @@ -10,6 +10,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { * Unpatched, this test passes only when Europe/London is not observing DST. * * @ticket 20328 + * + * @covers ::get_date_from_gmt */ public function test_get_date_from_gmt_outside_of_dst() { update_option( 'timezone_string', 'Europe/London' ); @@ -22,6 +24,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { * Unpatched, this test passes only when Europe/London is observing DST. * * @ticket 20328 + * + * @covers ::get_date_from_gmt */ public function test_get_date_from_gmt_during_dst() { update_option( 'timezone_string', 'Europe/London' ); @@ -32,6 +36,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 20328 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_outside_of_dst() { update_option( 'timezone_string', 'Europe/London' ); @@ -42,6 +48,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 20328 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_during_dst() { update_option( 'timezone_string', 'Europe/London' ); @@ -52,6 +60,9 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 34279 + * + * @covers ::get_date_from_gmt + * */ public function test_get_date_and_time_from_gmt_no_timezone() { $local = '2012-01-01 12:34:56'; @@ -61,6 +72,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 34279 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_no_timezone() { $gmt = '2012-12-01 00:00:00'; @@ -70,6 +83,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 34279 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_short_date() { update_option( 'timezone_string', 'Europe/London' ); @@ -80,6 +95,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 34279 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_string_date() { update_option( 'timezone_string', 'Europe/London' ); @@ -90,6 +107,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { /** * @ticket 34279 + * + * @covers ::get_gmt_from_date */ public function test_get_gmt_from_date_string_date_no_timezone() { $local = 'now'; @@ -101,6 +120,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { * @ticket 31809 * * @dataProvider timezone_provider + * + * @covers ::get_gmt_from_date */ public function test_gmt_from_date_correct_time( $timezone_string, $gmt_offset ) { update_option( 'timezone_string', $timezone_string ); @@ -117,6 +138,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { * @ticket 31809 * * @dataProvider timezone_provider + * + * @covers ::get_date_from_gmt */ public function test_date_from_gmt_correct_time( $timezone_string, $gmt_offset ) { update_option( 'timezone_string', $timezone_string ); @@ -133,6 +156,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase { * @ticket 31809 * * @dataProvider timezone_provider + * + * @covers ::iso8601_to_datetime */ public function test_is8601_to_datetime_correct_time( $timezone_string, $gmt_offset ) { update_option( 'timezone_string', $timezone_string ); diff --git a/tests/phpunit/tests/formatting/emoji.php b/tests/phpunit/tests/formatting/emoji.php index d3fb98e82e..cff36ccb8a 100644 --- a/tests/phpunit/tests/formatting/emoji.php +++ b/tests/phpunit/tests/formatting/emoji.php @@ -11,6 +11,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 36525 + * + * @covers ::_print_emoji_detection_script */ public function test_unfiltered_emoji_cdns() { // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present: @@ -27,6 +29,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 36525 + * + * @covers ::_print_emoji_detection_script */ public function test_filtered_emoji_svn_cdn() { $filtered_svn_cdn = $this->_filtered_emoji_svn_cdn(); @@ -50,6 +54,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 36525 + * + * @covers ::_print_emoji_detection_script */ public function test_filtered_emoji_png_cdn() { $filtered_png_cdn = $this->_filtered_emoji_png_cdn(); @@ -69,6 +75,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 41501 + * + * @covers ::_wp_emoji_list */ public function test_wp_emoji_list_returns_data() { $default = _wp_emoji_list(); @@ -113,6 +121,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 35293 * @dataProvider data_wp_encode_emoji + * + * @covers ::wp_encode_emoji */ public function test_wp_encode_emoji( $emoji, $expected ) { $this->assertSame( $expected, wp_encode_emoji( $emoji ) ); @@ -148,6 +158,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase { /** * @ticket 35293 * @dataProvider data_wp_staticize_emoji + * + * @covers ::wp_staticize_emoji */ public function test_wp_staticize_emoji( $emoji, $expected ) { $this->assertSame( $expected, wp_staticize_emoji( $emoji ) ); diff --git a/tests/phpunit/tests/formatting/ent2ncr.php b/tests/phpunit/tests/formatting/ent2ncr.php index f5859974ef..daf7f44b4d 100644 --- a/tests/phpunit/tests/formatting/ent2ncr.php +++ b/tests/phpunit/tests/formatting/ent2ncr.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::ent2ncr */ class Tests_Formatting_Ent2ncr extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/escAttr.php b/tests/phpunit/tests/formatting/escAttr.php index e60c5e9552..879b86ed05 100644 --- a/tests/phpunit/tests/formatting/escAttr.php +++ b/tests/phpunit/tests/formatting/escAttr.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::esc_attr */ class Tests_Formatting_EscAttr extends WP_UnitTestCase { public function test_esc_attr_quotes() { diff --git a/tests/phpunit/tests/formatting/escHtml.php b/tests/phpunit/tests/formatting/escHtml.php index 3c6b918cfc..bcd21043d7 100644 --- a/tests/phpunit/tests/formatting/escHtml.php +++ b/tests/phpunit/tests/formatting/escHtml.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::esc_html */ class Tests_Formatting_EscHtml extends WP_UnitTestCase { public function test_esc_html_basics() { diff --git a/tests/phpunit/tests/formatting/escJs.php b/tests/phpunit/tests/formatting/escJs.php index ddb5420174..0f4365d1b3 100644 --- a/tests/phpunit/tests/formatting/escJs.php +++ b/tests/phpunit/tests/formatting/escJs.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::esc_js */ class Tests_Formatting_EscJs extends WP_UnitTestCase { public function test_js_escape_simple() { diff --git a/tests/phpunit/tests/formatting/escTextarea.php b/tests/phpunit/tests/formatting/escTextarea.php index 8582216ec8..f53f5bd313 100644 --- a/tests/phpunit/tests/formatting/escTextarea.php +++ b/tests/phpunit/tests/formatting/escTextarea.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::esc_textarea */ class Tests_Formatting_EscTextarea extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/escUrl.php b/tests/phpunit/tests/formatting/escUrl.php index 678fc50100..d81ac9a95c 100644 --- a/tests/phpunit/tests/formatting/escUrl.php +++ b/tests/phpunit/tests/formatting/escUrl.php @@ -7,6 +7,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @ticket 23605 + * + * @covers ::esc_url */ public function test_spaces() { $this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr WordPress' ) ); @@ -19,6 +21,9 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $this->assertSame( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) ); } + /** + * @covers ::esc_url + */ public function test_bad_characters() { $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0Ago' ) ); $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0ago' ) ); @@ -33,6 +38,9 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADa' ) ); } + /** + * @covers ::esc_url + */ public function test_relative() { $this->assertSame( '/example.php', esc_url( '/example.php' ) ); $this->assertSame( 'example.php', esc_url( 'example.php' ) ); @@ -40,6 +48,10 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $this->assertSame( '?foo=bar', esc_url( '?foo=bar' ) ); } + /** + * @covers ::esc_url + * @covers ::esc_url_raw + */ public function test_all_url_parts() { $url = 'https://user:pass@host.example.com:1234/path;p=1?query=2&r[]=3#fragment'; @@ -56,10 +68,13 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { ), parse_url( $url ) ); - $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', sanitize_url( $url ) ); + $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) ); $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url( $url ) ); } + /** + * @covers ::esc_url + */ public function test_bare() { $this->assertSame( 'http://example.com?foo', esc_url( 'example.com?foo' ) ); $this->assertSame( 'http://example.com', esc_url( 'example.com' ) ); @@ -68,10 +83,14 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $this->assertSame( 'http://баба.org/баба', esc_url( 'баба.org/баба' ) ); } + /** + * @covers ::esc_url + * @covers ::esc_url_raw + */ public function test_encoding() { - $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); - $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); - $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); + $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) ); + $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) ); + $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) ); $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) ); $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) ); @@ -81,6 +100,10 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $this->assertSame( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) ); } + /** + * @covers ::esc_url + * @covers ::wp_allowed_protocols + */ public function test_protocol() { $this->assertSame( 'http://example.com', esc_url( 'http://example.com' ) ); $this->assertSame( '', esc_url( 'nasty://example.com/' ) ); @@ -145,23 +168,34 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @ticket 23187 + * + * @covers ::esc_url */ public function test_protocol_case() { $this->assertSame( 'http://example.com', esc_url( 'HTTP://example.com' ) ); $this->assertSame( 'http://example.com', esc_url( 'Http://example.com' ) ); } + /** + * @covers ::esc_url + */ public function test_display_extras() { $this->assertSame( 'http://example.com/'quoted'', esc_url( 'http://example.com/\'quoted\'' ) ); $this->assertSame( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) ); } + /** + * @covers ::esc_url + */ public function test_non_ascii() { $this->assertSame( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) ); $this->assertSame( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) ); $this->assertSame( 'http://müller.com/', esc_url( 'http://müller.com/' ) ); } + /** + * @covers ::esc_url + */ public function test_feed() { $this->assertSame( '', esc_url( 'feed:javascript:alert(1)' ) ); $this->assertSame( '', esc_url( 'feed:javascript:feed:alert(1)' ) ); @@ -172,6 +206,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @ticket 16859 + * + * @covers ::esc_url */ public function test_square_brackets() { $this->assertSame( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) ); @@ -187,14 +223,18 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding + * + * @covers ::esc_url_raw */ public function test_reserved_characters() { $url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;="; - $this->assertSame( $url, sanitize_url( $url ) ); + $this->assertSame( $url, esc_url_raw( $url ) ); } /** * @ticket 21974 + * + * @covers ::esc_url */ public function test_protocol_relative_with_colon() { $this->assertSame( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) ); @@ -202,6 +242,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @ticket 31632 + * + * @covers ::esc_url */ public function test_mailto_with_newline() { $body = <<assertEmpty( sanitize_url( '"^<>{}`' ) ); + $this->assertEmpty( esc_url_raw( '"^<>{}`' ) ); } /** * @ticket 34202 + * + * @covers ::esc_url */ public function test_ipv6_hosts() { $this->assertSame( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) ); diff --git a/tests/phpunit/tests/formatting/escXml.php b/tests/phpunit/tests/formatting/escXml.php index 435bc398a6..bce29da9df 100644 --- a/tests/phpunit/tests/formatting/escXml.php +++ b/tests/phpunit/tests/formatting/escXml.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::esc_xml */ class Tests_Formatting_EscXml extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php index 5657047556..9ee037c420 100644 --- a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php +++ b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php @@ -2,7 +2,6 @@ /** * @group formatting - * @covers ::excerpt_remove_blocks * @ticket 46133 */ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase { @@ -91,6 +90,8 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase { * Tests excerpt_remove_blocks(). * * @ticket 46133 + * + * @covers ::excerpt_remove_blocks */ public function test_excerpt_remove_blocks() { // Simple dynamic block.. @@ -116,6 +117,8 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase { * `the_content` gets applied, just like shortcodes. * * @ticket 46133 + * + * @covers ::do_blocks */ public function test_excerpt_infinite_loop() { $query = new WP_Query( diff --git a/tests/phpunit/tests/formatting/getBloginfo.php b/tests/phpunit/tests/formatting/getBloginfo.php index 2c80cd99b8..2b08f9edc2 100644 --- a/tests/phpunit/tests/formatting/getBloginfo.php +++ b/tests/phpunit/tests/formatting/getBloginfo.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::get_bloginfo */ class Tests_Formatting_GetBloginfo extends WP_UnitTestCase { @@ -35,6 +37,7 @@ class Tests_Formatting_GetBloginfo extends WP_UnitTestCase { /** * @ticket 27942 + * @covers ::sanitize_option */ public function test_bloginfo_sanitize_option() { $old_values = array( diff --git a/tests/phpunit/tests/formatting/getUrlInContent.php b/tests/phpunit/tests/formatting/getUrlInContent.php index 242fe2db9c..dd79769998 100644 --- a/tests/phpunit/tests/formatting/getUrlInContent.php +++ b/tests/phpunit/tests/formatting/getUrlInContent.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::get_url_in_content */ class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/humanTimeDiff.php b/tests/phpunit/tests/formatting/humanTimeDiff.php index f4eb2e2ad6..829487c370 100644 --- a/tests/phpunit/tests/formatting/humanTimeDiff.php +++ b/tests/phpunit/tests/formatting/humanTimeDiff.php @@ -3,6 +3,8 @@ /** * @group formatting * @ticket 38773 + * + * @covers ::human_time_diff */ class Tests_Formatting_HumanTimeDiff extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/isEmail.php b/tests/phpunit/tests/formatting/isEmail.php index eea7b61926..c3f0a7c45b 100644 --- a/tests/phpunit/tests/formatting/isEmail.php +++ b/tests/phpunit/tests/formatting/isEmail.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::is_email */ class Tests_Formatting_IsEmail extends WP_UnitTestCase { public function test_returns_the_email_address_if_it_is_valid() { diff --git a/tests/phpunit/tests/formatting/likeEscape.php b/tests/phpunit/tests/formatting/likeEscape.php index d24f4e6675..4902056730 100644 --- a/tests/phpunit/tests/formatting/likeEscape.php +++ b/tests/phpunit/tests/formatting/likeEscape.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::like_escape */ class Tests_Formatting_LikeEscape extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/linksAddTarget.php b/tests/phpunit/tests/formatting/linksAddTarget.php index ce8e506440..2bf582824f 100644 --- a/tests/phpunit/tests/formatting/linksAddTarget.php +++ b/tests/phpunit/tests/formatting/linksAddTarget.php @@ -1,6 +1,8 @@ expectException( 'WPDieException' ); @@ -41,6 +43,9 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { ); } + /** + * @covers ::wp_sanitize_redirect + */ public function test_wp_sanitize_redirect() { $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0Ago' ) ); $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0ago' ) ); @@ -59,6 +64,8 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { /** * @ticket 36998 + * + * @covers ::wp_sanitize_redirect */ public function test_wp_sanitize_redirect_should_encode_spaces() { $this->assertSame( 'http://example.com/test%20spaces', wp_sanitize_redirect( 'http://example.com/test%20spaces' ) ); @@ -67,6 +74,8 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { /** * @dataProvider valid_url_provider + * + * @covers ::wp_validate_redirect */ public function test_wp_validate_redirect_valid_url( $url, $expected ) { $this->assertSame( $expected, wp_validate_redirect( $url ) ); @@ -74,6 +83,8 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { /** * @dataProvider invalid_url_provider + * + * @covers ::wp_validate_redirect */ public function test_wp_validate_redirect_invalid_url( $url ) { $this->assertEquals( false, wp_validate_redirect( $url, false ) ); @@ -166,6 +177,8 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { /** * @ticket 47980 * @dataProvider relative_url_provider + * + * @covers ::wp_validate_redirect */ public function test_wp_validate_redirect_relative_url( $current_uri, $url, $expected ) { // Backup the global. diff --git a/tests/phpunit/tests/formatting/removeAccents.php b/tests/phpunit/tests/formatting/removeAccents.php index 2ebea564a5..249625ca3b 100644 --- a/tests/phpunit/tests/formatting/removeAccents.php +++ b/tests/phpunit/tests/formatting/removeAccents.php @@ -2,8 +2,11 @@ /** * @group formatting + * + * @covers ::remove_accents */ class Tests_Formatting_RemoveAccents extends WP_UnitTestCase { + public function test_remove_accents_simple() { $this->assertSame( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) ); } diff --git a/tests/phpunit/tests/formatting/sanitizeFileName.php b/tests/phpunit/tests/formatting/sanitizeFileName.php index fbec256219..06c2f10976 100644 --- a/tests/phpunit/tests/formatting/sanitizeFileName.php +++ b/tests/phpunit/tests/formatting/sanitizeFileName.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_file_name */ class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase { public function test_munges_extensions() { diff --git a/tests/phpunit/tests/formatting/sanitizeMimeType.php b/tests/phpunit/tests/formatting/sanitizeMimeType.php index 77c8b47205..6d486159a6 100644 --- a/tests/phpunit/tests/formatting/sanitizeMimeType.php +++ b/tests/phpunit/tests/formatting/sanitizeMimeType.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_mime_type */ class Tests_Formatting_SanitizeMimeType extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/sanitizeOrderby.php b/tests/phpunit/tests/formatting/sanitizeOrderby.php index cede007886..8384f8a4b2 100644 --- a/tests/phpunit/tests/formatting/sanitizeOrderby.php +++ b/tests/phpunit/tests/formatting/sanitizeOrderby.php @@ -2,11 +2,12 @@ /** * @group sanitize_sql_orderby + * + * @covers ::sanitize_sql_orderby */ class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase { /** - * @covers ::sanitize_sql_orderby * @dataProvider valid_orderbys */ public function test_valid( $orderby ) { @@ -33,7 +34,6 @@ class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase { } /** - * @covers ::sanitize_sql_orderby * @dataProvider invalid_orderbys */ public function test_invalid( $orderby ) { diff --git a/tests/phpunit/tests/formatting/sanitizePost.php b/tests/phpunit/tests/formatting/sanitizePost.php index 1e69e703c1..642265ba95 100644 --- a/tests/phpunit/tests/formatting/sanitizePost.php +++ b/tests/phpunit/tests/formatting/sanitizePost.php @@ -2,6 +2,8 @@ /** * @group formatting * @group post + * + * @covers WP_Post::__construct */ class Tests_Formatting_SanitizePost extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/sanitizeTextField.php b/tests/phpunit/tests/formatting/sanitizeTextField.php index 8d5d0ff0dd..15e903ac95 100644 --- a/tests/phpunit/tests/formatting/sanitizeTextField.php +++ b/tests/phpunit/tests/formatting/sanitizeTextField.php @@ -2,6 +2,9 @@ /** * @group formatting + * + * @covers ::sanitize_text_field + * @covers ::sanitize_textarea_field */ class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase { public function data_sanitize_text_field() { diff --git a/tests/phpunit/tests/formatting/sanitizeTitle.php b/tests/phpunit/tests/formatting/sanitizeTitle.php index 7ce850f0fc..faecb8c2c9 100644 --- a/tests/phpunit/tests/formatting/sanitizeTitle.php +++ b/tests/phpunit/tests/formatting/sanitizeTitle.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_title */ class Tests_Formatting_SanitizeTitle extends WP_UnitTestCase { public function test_strips_html() { diff --git a/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php b/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php index 797a36f018..0fc199013a 100644 --- a/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php +++ b/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_title_with_dashes */ class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase { public function test_strips_html() { diff --git a/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php b/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php index 8337a2a662..9e9c096a76 100644 --- a/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php +++ b/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_trackback_urls */ class Tests_Formatting_SanitizeTrackbackUrls extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/sanitizeUser.php b/tests/phpunit/tests/formatting/sanitizeUser.php index e0ae998f5e..1f1cadd884 100644 --- a/tests/phpunit/tests/formatting/sanitizeUser.php +++ b/tests/phpunit/tests/formatting/sanitizeUser.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::sanitize_user */ class Tests_Formatting_SanitizeUser extends WP_UnitTestCase { public function test_strips_html() { diff --git a/tests/phpunit/tests/formatting/seemsUtf8.php b/tests/phpunit/tests/formatting/seemsUtf8.php index a5a6157fd2..5e9bb8e8a1 100644 --- a/tests/phpunit/tests/formatting/seemsUtf8.php +++ b/tests/phpunit/tests/formatting/seemsUtf8.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::seems_utf8 */ class Tests_Formatting_SeemsUtf8 extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/slashit.php b/tests/phpunit/tests/formatting/slashit.php index 9c32aa2c64..903cf9f65f 100644 --- a/tests/phpunit/tests/formatting/slashit.php +++ b/tests/phpunit/tests/formatting/slashit.php @@ -4,18 +4,31 @@ * @group formatting */ class Tests_Formatting_Slashit extends WP_UnitTestCase { + + /** + * @covers ::backslashit + */ public function test_backslashes_middle_numbers() { $this->assertSame( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) ); } + /** + * @covers ::backslashit + */ public function test_backslashes_alphas() { $this->assertSame( "\\a943\\b\\c", backslashit( 'a943bc' ) ); } + /** + * @covers ::backslashit + */ public function test_double_backslashes_leading_numbers() { $this->assertSame( '\\\\95', backslashit( '95' ) ); } + /** + * @covers ::untrailingslashit + */ public function test_removes_trailing_slashes() { $this->assertSame( 'a', untrailingslashit( 'a/' ) ); $this->assertSame( 'a', untrailingslashit( 'a////' ) ); @@ -23,6 +36,8 @@ class Tests_Formatting_Slashit extends WP_UnitTestCase { /** * @ticket 22267 + * + * @covers ::untrailingslashit */ public function test_removes_trailing_backslashes() { $this->assertSame( 'a', untrailingslashit( 'a\\' ) ); @@ -31,22 +46,32 @@ class Tests_Formatting_Slashit extends WP_UnitTestCase { /** * @ticket 22267 + * + * @covers ::untrailingslashit */ public function test_removes_trailing_mixed_slashes() { $this->assertSame( 'a', untrailingslashit( 'a/\\' ) ); $this->assertSame( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) ); } + /** + * @covers ::trailingslashit + */ public function test_adds_trailing_slash() { $this->assertSame( 'a/', trailingslashit( 'a' ) ); } + /** + * @covers ::trailingslashit + */ public function test_does_not_add_trailing_slash_if_one_exists() { $this->assertSame( 'a/', trailingslashit( 'a/' ) ); } /** * @ticket 22267 + * + * @covers ::trailingslashit */ public function test_converts_trailing_backslash_to_slash_if_one_exists() { $this->assertSame( 'a/', trailingslashit( 'a\\' ) ); diff --git a/tests/phpunit/tests/formatting/stripslashesDeep.php b/tests/phpunit/tests/formatting/stripslashesDeep.php index c5ce91b44b..76f9e8b019 100644 --- a/tests/phpunit/tests/formatting/stripslashesDeep.php +++ b/tests/phpunit/tests/formatting/stripslashesDeep.php @@ -3,6 +3,8 @@ /** * @group formatting * @group slashes + * + * @covers ::stripslashes_deep */ class Tests_Formatting_StripslashesDeep extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/urlShorten.php b/tests/phpunit/tests/formatting/urlShorten.php index 5900e358e9..4909130dbc 100644 --- a/tests/phpunit/tests/formatting/urlShorten.php +++ b/tests/phpunit/tests/formatting/urlShorten.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::url_shorten */ class Tests_Formatting_UrlShorten extends WP_UnitTestCase { public function test_url_shorten() { diff --git a/tests/phpunit/tests/formatting/urlencodeDeep.php b/tests/phpunit/tests/formatting/urlencodeDeep.php index 27c0c750bb..a3b461a6ae 100644 --- a/tests/phpunit/tests/formatting/urlencodeDeep.php +++ b/tests/phpunit/tests/formatting/urlencodeDeep.php @@ -3,6 +3,8 @@ /** * @group formatting * @ticket 22300 + * + * @covers ::urlencode_deep */ class Tests_Formatting_UrlencodeDeep extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/utf8UriEncode.php b/tests/phpunit/tests/formatting/utf8UriEncode.php index 310b906104..e82e973e29 100644 --- a/tests/phpunit/tests/formatting/utf8UriEncode.php +++ b/tests/phpunit/tests/formatting/utf8UriEncode.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::utf8_uri_encode */ class Tests_Formatting_Utf8UriEncode extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpAutop.php b/tests/phpunit/tests/formatting/wpAutop.php index 1ef30f9642..a330f8a45d 100644 --- a/tests/phpunit/tests/formatting/wpAutop.php +++ b/tests/phpunit/tests/formatting/wpAutop.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wpautop */ class Tests_Formatting_wpAutop extends WP_UnitTestCase { @@ -541,10 +543,9 @@ line 2
/** * wpautop() should not add extra

before
* - * @covers ::wpautop - * @uses ::trim - * * @ticket 39307 + * + * @uses ::trim */ public function test_that_wpautop_does_not_add_extra_closing_p_in_figure() { $content1 = '
Caption
'; diff --git a/tests/phpunit/tests/formatting/wpBasename.php b/tests/phpunit/tests/formatting/wpBasename.php index 6bb7d5684b..57a00d872f 100644 --- a/tests/phpunit/tests/formatting/wpBasename.php +++ b/tests/phpunit/tests/formatting/wpBasename.php @@ -2,6 +2,8 @@ /** * @group formatting + + * @covers ::wp_basename */ class Tests_Formatting_wpBasename extends WP_UnitTestCase { @@ -38,5 +40,4 @@ class Tests_Formatting_wpBasename extends WP_UnitTestCase { wp_basename( 'C:\test\щипцы.txt' ) ); } - } diff --git a/tests/phpunit/tests/formatting/wpHtmlExcerpt.php b/tests/phpunit/tests/formatting/wpHtmlExcerpt.php index 3aff259343..96cd58226d 100644 --- a/tests/phpunit/tests/formatting/wpHtmlExcerpt.php +++ b/tests/phpunit/tests/formatting/wpHtmlExcerpt.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_html_excerpt */ class Tests_Formatting_wpHtmlExcerpt extends WP_UnitTestCase { public function test_simple() { diff --git a/tests/phpunit/tests/formatting/wpHtmlSplit.php b/tests/phpunit/tests/formatting/wpHtmlSplit.php index befe43abb8..e606b1084c 100644 --- a/tests/phpunit/tests/formatting/wpHtmlSplit.php +++ b/tests/phpunit/tests/formatting/wpHtmlSplit.php @@ -9,6 +9,8 @@ class Tests_Formatting_wpHtmlSplit extends WP_UnitTestCase { * Basic functionality goes here. * * @dataProvider data_basic_features + * + * @covers ::wp_html_split */ public function test_basic_features( $input, $output ) { return $this->assertSame( $output, wp_html_split( $input ) ); @@ -39,6 +41,8 @@ class Tests_Formatting_wpHtmlSplit extends WP_UnitTestCase { * Automated performance testing of the main regex. * * @dataProvider data_whole_posts + * + * @covers ::preg_split */ public function test_pcre_performance( $input ) { $regex = get_html_split_regex(); diff --git a/tests/phpunit/tests/formatting/wpHtmleditPre.php b/tests/phpunit/tests/formatting/wpHtmleditPre.php index 109ea4bdf2..f9eb7dcc3c 100644 --- a/tests/phpunit/tests/formatting/wpHtmleditPre.php +++ b/tests/phpunit/tests/formatting/wpHtmleditPre.php @@ -3,6 +3,8 @@ /** * @group formatting * @expectedDeprecated wp_htmledit_pre + * + * @covers ::wp_htmledit_pre */ class Tests_Formatting_wpHtmleditPre extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpIsoDescrambler.php b/tests/phpunit/tests/formatting/wpIsoDescrambler.php index a15cabc4d2..643ebcc836 100644 --- a/tests/phpunit/tests/formatting/wpIsoDescrambler.php +++ b/tests/phpunit/tests/formatting/wpIsoDescrambler.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_iso_descrambler */ class Tests_Formatting_wpIsoDescrambler extends WP_UnitTestCase { /* diff --git a/tests/phpunit/tests/formatting/wpMakeLinkRelative.php b/tests/phpunit/tests/formatting/wpMakeLinkRelative.php index ee3f78e9a2..0b293c9c89 100644 --- a/tests/phpunit/tests/formatting/wpMakeLinkRelative.php +++ b/tests/phpunit/tests/formatting/wpMakeLinkRelative.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_make_link_relative */ class Tests_Formatting_wpMakeLinkRelative extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpRelNofollow.php b/tests/phpunit/tests/formatting/wpRelNofollow.php index d10898d7ea..0b45d22e15 100644 --- a/tests/phpunit/tests/formatting/wpRelNofollow.php +++ b/tests/phpunit/tests/formatting/wpRelNofollow.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_rel_nofollow */ class Tests_Formatting_wpRelNofollow extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpRelUgc.php b/tests/phpunit/tests/formatting/wpRelUgc.php index cbd052c71e..4b8b11dafa 100644 --- a/tests/phpunit/tests/formatting/wpRelUgc.php +++ b/tests/phpunit/tests/formatting/wpRelUgc.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_rel_ugc */ class Tests_Formatting_wpRelUgc extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php b/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php index 9781dfbc1b..b16fd5e7f1 100644 --- a/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php +++ b/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_replace_in_html_tags */ class Tests_Formatting_wpReplaceInHtmlTags extends WP_UnitTestCase { /** diff --git a/tests/phpunit/tests/formatting/wpRicheditPre.php b/tests/phpunit/tests/formatting/wpRicheditPre.php index be12ddd55f..04f85c6255 100644 --- a/tests/phpunit/tests/formatting/wpRicheditPre.php +++ b/tests/phpunit/tests/formatting/wpRicheditPre.php @@ -3,6 +3,8 @@ /** * @group formatting * @expectedDeprecated wp_richedit_pre + * + * @covers ::wp_richedit_pre */ class Tests_Formatting_wpRicheditPre extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpSlash.php b/tests/phpunit/tests/formatting/wpSlash.php index 0431b7602d..39a7c32a01 100644 --- a/tests/phpunit/tests/formatting/wpSlash.php +++ b/tests/phpunit/tests/formatting/wpSlash.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_slash */ class Tests_Formatting_wpSlash extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpSpecialchars.php b/tests/phpunit/tests/formatting/wpSpecialchars.php index 07fc2b1ad0..890fb99c94 100644 --- a/tests/phpunit/tests/formatting/wpSpecialchars.php +++ b/tests/phpunit/tests/formatting/wpSpecialchars.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::_wp_specialchars */ class Tests_Formatting_wpSpecialchars extends WP_UnitTestCase { public function test_wp_specialchars_basics() { diff --git a/tests/phpunit/tests/formatting/wpStripAllTags.php b/tests/phpunit/tests/formatting/wpStripAllTags.php index 1ecc12bda4..2ef332e62e 100644 --- a/tests/phpunit/tests/formatting/wpStripAllTags.php +++ b/tests/phpunit/tests/formatting/wpStripAllTags.php @@ -3,6 +3,8 @@ * Test wp_strip_all_tags() * * @group formatting + * + * @covers ::wp_strip_all_tags */ class Tests_Formatting_wpStripAllTags extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpTargetedLinkRel.php b/tests/phpunit/tests/formatting/wpTargetedLinkRel.php index b58f4188b5..82e6e399f5 100644 --- a/tests/phpunit/tests/formatting/wpTargetedLinkRel.php +++ b/tests/phpunit/tests/formatting/wpTargetedLinkRel.php @@ -3,6 +3,8 @@ /** * @group formatting * @ticket 43187 + * + * @covers ::wp_targeted_link_rel */ class Tests_Formatting_wpTargetedLinkRel extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpTexturize.php b/tests/phpunit/tests/formatting/wpTexturize.php index 8ac9bb3784..9bfc371461 100644 --- a/tests/phpunit/tests/formatting/wpTexturize.php +++ b/tests/phpunit/tests/formatting/wpTexturize.php @@ -4,11 +4,18 @@ * @group formatting */ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { + + /** + * @covers ::wptexturize + */ public function test_dashes() { $this->assertSame( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) ); $this->assertSame( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) ); } + /** + * @covers ::wptexturize + */ public function test_disable() { $this->assertSame( '
---&
', wptexturize( '
---&
' ) ); $this->assertSame( '
--&
', wptexturize( '
--&
' ) ); @@ -34,6 +41,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 1418 + * + * @covers ::wptexturize */ public function test_bracketed_quotes_1418() { $this->assertSame( '(“test”)', wptexturize( '("test")' ) ); @@ -43,6 +52,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 3810 + * + * @covers ::wptexturize */ public function test_bracketed_quotes_3810() { $this->assertSame( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) ); @@ -50,6 +61,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 + * + * @covers ::wptexturize */ public function test_basic_quotes() { $this->assertSame( 'test’s', wptexturize( 'test\'s' ) ); @@ -73,6 +86,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 + * + * @covers ::wptexturize */ public function test_full_sentences_with_unmatched_single_quotes() { $this->assertSame( @@ -83,6 +98,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 + * + * @covers ::wptexturize */ public function test_quotes() { $this->assertSame( '“Quoted String”', wptexturize( '"Quoted String"' ) ); @@ -102,6 +119,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 + * + * @covers ::wptexturize */ public function test_quotes_before_s() { $this->assertSame( 'test’s', wptexturize( "test's" ) ); @@ -113,6 +132,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 + * + * @covers ::wptexturize */ public function test_quotes_before_numbers() { $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) ); @@ -141,6 +162,9 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { $this->assertSame( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) ); } + /** + * @covers ::wptexturize + */ public function test_quotes_after_numbers() { $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) ); } @@ -148,6 +172,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 + * + * @covers ::wptexturize */ public function test_other_html() { $this->assertSame( '‘', wptexturize( "'" ) ); @@ -155,10 +181,16 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { // $this->assertSame( '“Quoted Text”,', wptexturize( '"Quoted Text",' ) ); } + /** + * @covers ::wptexturize + */ public function test_x() { $this->assertSame( '14×24', wptexturize( '14x24' ) ); } + /** + * @covers ::wptexturize + */ public function test_minutes_seconds() { $this->assertSame( '9′', wptexturize( '9\'' ) ); $this->assertSame( '9″', wptexturize( '9"' ) ); @@ -172,6 +204,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 8775 + * + * @covers ::wptexturize */ public function test_wptexturize_quotes_around_numbers() { $this->assertSame( '“12345”', wptexturize( '"12345"' ) ); @@ -182,6 +216,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 8912 + * + * @covers ::wptexturize */ public function test_wptexturize_html_comments() { $this->assertSame( '', wptexturize( '' ) ); @@ -192,6 +228,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 + * + * @covers ::wptexturize */ public function test_entity_quote_cuddling() { $this->assertSame( ' “Testing”', wptexturize( ' "Testing"' ) ); @@ -200,6 +238,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 22823 + * + * @covers ::wptexturize */ public function test_apostrophes_before_primes() { $this->assertSame( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) ); @@ -207,6 +247,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 23185 + * + * @covers ::wptexturize */ public function test_spaces_around_hyphens() { $nbsp = "\xC2\xA0"; @@ -230,6 +272,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 31030 + * + * @covers ::wptexturize */ public function test_hyphens_at_start_and_end() { $this->assertSame( '– ', wptexturize( '- ' ) ); @@ -247,6 +291,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * These should never happen, even if the desired output changes some day. * * @ticket 22692 + * + * @covers ::wptexturize */ public function test_spaces_around_quotes_never() { $nbsp = "\xC2\xA0"; @@ -264,9 +310,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_spaces_around_quotes + * + * @covers ::wptexturize */ public function test_spaces_around_quotes( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_spaces_around_quotes() { @@ -320,9 +368,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_apos_before_digits + * + * @covers ::wptexturize */ public function test_apos_before_digits( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_apos_before_digits() { @@ -361,9 +411,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_opening_single_quote + * + * @covers ::wptexturize */ public function test_opening_single_quote( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_opening_single_quote() { @@ -490,9 +542,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_double_prime + * + * @covers ::wptexturize */ public function test_double_prime( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_double_prime() { @@ -523,9 +577,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_single_prime + * + * @covers ::wptexturize */ public function test_single_prime( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_single_prime() { @@ -556,9 +612,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_contractions + * + * @covers ::wptexturize */ public function test_contractions( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_contractions() { @@ -597,9 +655,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_opening_quote + * + * @covers ::wptexturize */ public function test_opening_quote( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_opening_quote() { @@ -674,9 +734,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_closing_quote + * + * @covers ::wptexturize */ public function test_closing_quote( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_closing_quote() { @@ -763,9 +825,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_closing_single_quote + * + * @covers ::wptexturize */ public function test_closing_single_quote( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_closing_single_quote() { @@ -853,9 +917,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * @ticket 22692 * @ticket 30445 * @dataProvider data_multiplication + * + * @covers ::wptexturize */ public function test_multiplication( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_multiplication() { @@ -903,9 +969,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_ampersand + * + * @covers ::wptexturize */ public function test_ampersand( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_ampersand() { @@ -968,9 +1036,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_cockney + * + * @covers ::wptexturize */ public function test_cockney( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_cockney() { @@ -1029,9 +1099,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_smart_dashes + * + * @covers ::wptexturize */ public function test_smart_dashes( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_smart_dashes() { @@ -1082,9 +1154,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_misc_static_replacements + * + * @covers ::wptexturize */ public function test_misc_static_replacements( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_misc_static_replacements() { @@ -1137,9 +1211,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 8775 * @dataProvider data_quoted_numbers + * + * @covers ::wptexturize */ public function test_quoted_numbers( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_quoted_numbers() { @@ -1188,9 +1264,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 20342 * @dataProvider data_quotes_and_dashes + * + * @covers ::wptexturize */ public function test_quotes_and_dashes( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_quotes_and_dashes() { @@ -1251,9 +1329,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 12690 * @dataProvider data_tag_avoidance + * + * @covers ::wptexturize */ public function test_tag_avoidance( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_tag_avoidance() { @@ -1474,9 +1554,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 26850 * @dataProvider data_year_abbr + * + * @covers ::wptexturize */ public function test_year_abbr( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_year_abbr() { @@ -1563,6 +1645,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 27426 * @dataProvider data_translate + * + * @covers ::wptexturize */ public function test_translate( $input, $output ) { add_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 ); @@ -1572,7 +1656,7 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 ); wptexturize( 'reset', true ); - return $this->assertSame( $output, $result ); + $this->assertSame( $output, $result ); } public function filter_translate( $translations, $text, $context, $domain ) { @@ -1790,9 +1874,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 28483 * @dataProvider data_element_stack + * + * @covers ::wptexturize */ public function test_element_stack( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_element_stack() { @@ -1841,6 +1927,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 29557 * @dataProvider data_unregistered_shortcodes + * + * @covers ::wptexturize */ public function test_unregistered_shortcodes( $input, $output ) { add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 ); @@ -1926,9 +2014,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 29256 * @dataProvider data_primes_vs_quotes + * + * @covers ::wptexturize */ public function test_primes_vs_quotes( $input, $output ) { - return $this->assertSame( $output, wptexturize( $input ) ); + $this->assertSame( $output, wptexturize( $input ) ); } public function data_primes_vs_quotes() { @@ -1988,6 +2078,8 @@ String with a number followed by a single quote ‘Expendables 3’ vest * * @ticket 29256 * @dataProvider data_primes_quotes_translation + * + * @covers ::wptexturize */ public function test_primes_quotes_translation( $input, $output ) { add_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 ); @@ -1997,7 +2089,7 @@ String with a number followed by a single quote ‘Expendables 3’ vest remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 ); wptexturize( 'reset', true ); - return $this->assertSame( $output, $result ); + $this->assertSame( $output, $result ); } public function filter_translate2( $translations, $text, $context, $domain ) { @@ -2081,6 +2173,8 @@ String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum * Automated performance testing of the main regex. * * @dataProvider data_whole_posts + * + * @covers ::preg_split */ public function test_pcre_performance( $input ) { global $shortcode_tags; @@ -2101,6 +2195,8 @@ String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum * Ensure that a trailing less-than symbol doesn't cause a PHP warning. * * @ticket 35864 + * + * @covers ::wptexturize */ public function test_trailing_less_than() { $this->assertSame( 'F–oo<', wptexturize( 'F--oo<', true ) ); diff --git a/tests/phpunit/tests/formatting/wpTrimExcerpt.php b/tests/phpunit/tests/formatting/wpTrimExcerpt.php index ed5117bb56..c3ab336bf9 100644 --- a/tests/phpunit/tests/formatting/wpTrimExcerpt.php +++ b/tests/phpunit/tests/formatting/wpTrimExcerpt.php @@ -2,6 +2,7 @@ /** * @group formatting + * * @covers ::wp_trim_excerpt */ class Tests_Formatting_wpTrimExcerpt extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpTrimWords.php b/tests/phpunit/tests/formatting/wpTrimWords.php index 1becf2b5d2..b918fd1642 100644 --- a/tests/phpunit/tests/formatting/wpTrimWords.php +++ b/tests/phpunit/tests/formatting/wpTrimWords.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_trim_words */ class Tests_Formatting_wpTrimWords extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/zeroise.php b/tests/phpunit/tests/formatting/zeroise.php index c702fc4eb9..fb8f49897b 100644 --- a/tests/phpunit/tests/formatting/zeroise.php +++ b/tests/phpunit/tests/formatting/zeroise.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::zeroise */ class Tests_Formatting_Zeroise extends WP_UnitTestCase { public function test_pads_with_leading_zeroes() {