diff --git a/tests/phpunit/tests/formatting/escUrl.php b/tests/phpunit/tests/formatting/escUrl.php index 9c830cb570..dd37c9ec8d 100644 --- a/tests/phpunit/tests/formatting/escUrl.php +++ b/tests/phpunit/tests/formatting/escUrl.php @@ -2,13 +2,13 @@ /** * @group formatting + * + * @covers ::esc_url */ 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' ) ); @@ -21,9 +21,6 @@ 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' ) ); @@ -38,9 +35,6 @@ 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' ) ); @@ -49,7 +43,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { } /** - * @covers ::esc_url * @covers ::sanitize_url */ public function test_all_url_parts() { @@ -72,9 +65,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { $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' ) ); @@ -84,7 +74,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { } /** - * @covers ::esc_url * @covers ::sanitize_url */ public function test_encoding() { @@ -101,7 +90,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { } /** - * @covers ::esc_url * @covers ::wp_allowed_protocols */ public function test_protocol() { @@ -168,34 +156,23 @@ 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)' ) ); @@ -206,8 +183,6 @@ 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' ) ); @@ -233,8 +208,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @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' ) ); @@ -242,8 +215,6 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase { /** * @ticket 31632 - * - * @covers ::esc_url */ public function test_mailto_with_newline() { $body = <<assertSame( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) ); diff --git a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php index 20d08ee8bf..1f07596903 100644 --- a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php +++ b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php @@ -3,6 +3,8 @@ /** * @group formatting * @ticket 46133 + * + * @covers ::excerpt_remove_blocks */ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase { @@ -90,8 +92,6 @@ 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.. diff --git a/tests/phpunit/tests/formatting/getBloginfo.php b/tests/phpunit/tests/formatting/getBloginfo.php index 2b08f9edc2..0b6ab77358 100644 --- a/tests/phpunit/tests/formatting/getBloginfo.php +++ b/tests/phpunit/tests/formatting/getBloginfo.php @@ -37,6 +37,7 @@ class Tests_Formatting_GetBloginfo extends WP_UnitTestCase { /** * @ticket 27942 + * * @covers ::sanitize_option */ public function test_bloginfo_sanitize_option() { diff --git a/tests/phpunit/tests/formatting/sanitizeKey.php b/tests/phpunit/tests/formatting/sanitizeKey.php index 0fb5d905df..e39dd328db 100644 --- a/tests/phpunit/tests/formatting/sanitizeKey.php +++ b/tests/phpunit/tests/formatting/sanitizeKey.php @@ -2,6 +2,7 @@ /** * @group formatting + * * @covers ::sanitize_key */ class Tests_Formatting_SanitizeKey extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/sanitizePost.php b/tests/phpunit/tests/formatting/sanitizePost.php index 642265ba95..60ef8927aa 100644 --- a/tests/phpunit/tests/formatting/sanitizePost.php +++ b/tests/phpunit/tests/formatting/sanitizePost.php @@ -3,6 +3,7 @@ * @group formatting * @group post * + * @covers ::sanitize_post * @covers WP_Post::__construct */ class Tests_Formatting_SanitizePost extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpBasename.php b/tests/phpunit/tests/formatting/wpBasename.php index 57a00d872f..613c23b617 100644 --- a/tests/phpunit/tests/formatting/wpBasename.php +++ b/tests/phpunit/tests/formatting/wpBasename.php @@ -2,7 +2,7 @@ /** * @group formatting - + * * @covers ::wp_basename */ class Tests_Formatting_wpBasename extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpHtmlSplit.php b/tests/phpunit/tests/formatting/wpHtmlSplit.php index a174c43d00..750ad3821c 100644 --- a/tests/phpunit/tests/formatting/wpHtmlSplit.php +++ b/tests/phpunit/tests/formatting/wpHtmlSplit.php @@ -2,6 +2,8 @@ /** * @group formatting + * + * @covers ::wp_html_split */ class Tests_Formatting_wpHtmlSplit extends WP_UnitTestCase { @@ -9,8 +11,6 @@ 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 ) ); diff --git a/tests/phpunit/tests/formatting/wpParseStr.php b/tests/phpunit/tests/formatting/wpParseStr.php index b8c3d063d2..7a44d5fe96 100644 --- a/tests/phpunit/tests/formatting/wpParseStr.php +++ b/tests/phpunit/tests/formatting/wpParseStr.php @@ -2,6 +2,7 @@ /** * @group formatting + * * @covers ::wp_parse_str */ class Tests_Formatting_wpParseStr extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/formatting/wpTexturize.php b/tests/phpunit/tests/formatting/wpTexturize.php index 0650c78181..ee7ce5f779 100644 --- a/tests/phpunit/tests/formatting/wpTexturize.php +++ b/tests/phpunit/tests/formatting/wpTexturize.php @@ -2,20 +2,16 @@ /** * @group formatting + * + * @covers ::wptexturize */ 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( '
--&
' ) ); @@ -41,8 +37,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 1418 - * - * @covers ::wptexturize */ public function test_bracketed_quotes_1418() { $this->assertSame( '(“test”)', wptexturize( '("test")' ) ); @@ -52,8 +46,6 @@ 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.' ) ); @@ -61,8 +53,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 - * - * @covers ::wptexturize */ public function test_basic_quotes() { $this->assertSame( 'test’s', wptexturize( 'test\'s' ) ); @@ -86,8 +76,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 - * - * @covers ::wptexturize */ public function test_full_sentences_with_unmatched_single_quotes() { $this->assertSame( @@ -98,8 +86,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 - * - * @covers ::wptexturize */ public function test_quotes() { $this->assertSame( '“Quoted String”', wptexturize( '"Quoted String"' ) ); @@ -119,8 +105,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 - * - * @covers ::wptexturize */ public function test_quotes_before_s() { $this->assertSame( 'test’s', wptexturize( "test's" ) ); @@ -132,8 +116,6 @@ 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" ) ); @@ -162,9 +144,6 @@ 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" ) ); } @@ -172,8 +151,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 - * - * @covers ::wptexturize */ public function test_other_html() { $this->assertSame( '‘', wptexturize( "'" ) ); @@ -181,16 +158,10 @@ 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"' ) ); @@ -204,8 +175,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 8775 - * - * @covers ::wptexturize */ public function test_wptexturize_quotes_around_numbers() { $this->assertSame( '“12345”', wptexturize( '"12345"' ) ); @@ -216,8 +185,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 8912 - * - * @covers ::wptexturize */ public function test_wptexturize_html_comments() { $this->assertSame( '', wptexturize( '' ) ); @@ -228,8 +195,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 4539 * @ticket 15241 - * - * @covers ::wptexturize */ public function test_entity_quote_cuddling() { $this->assertSame( ' “Testing”', wptexturize( ' "Testing"' ) ); @@ -238,8 +203,6 @@ 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" ) ); @@ -247,8 +210,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 23185 - * - * @covers ::wptexturize */ public function test_spaces_around_hyphens() { $nbsp = "\xC2\xA0"; @@ -272,8 +233,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { /** * @ticket 31030 - * - * @covers ::wptexturize */ public function test_hyphens_at_start_and_end() { $this->assertSame( '– ', wptexturize( '- ' ) ); @@ -291,8 +250,6 @@ 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"; @@ -310,8 +267,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_spaces_around_quotes - * - * @covers ::wptexturize */ public function test_spaces_around_quotes( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -368,8 +323,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_apos_before_digits - * - * @covers ::wptexturize */ public function test_apos_before_digits( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -411,8 +364,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_opening_single_quote - * - * @covers ::wptexturize */ public function test_opening_single_quote( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -542,8 +493,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_double_prime - * - * @covers ::wptexturize */ public function test_double_prime( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -577,8 +526,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_single_prime - * - * @covers ::wptexturize */ public function test_single_prime( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -612,8 +559,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_contractions - * - * @covers ::wptexturize */ public function test_contractions( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -655,8 +600,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_opening_quote - * - * @covers ::wptexturize */ public function test_opening_quote( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -734,8 +677,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_closing_quote - * - * @covers ::wptexturize */ public function test_closing_quote( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -825,8 +766,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_closing_single_quote - * - * @covers ::wptexturize */ public function test_closing_single_quote( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -917,8 +856,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * @ticket 22692 * @ticket 30445 * @dataProvider data_multiplication - * - * @covers ::wptexturize */ public function test_multiplication( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -969,8 +906,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_ampersand - * - * @covers ::wptexturize */ public function test_ampersand( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1036,8 +971,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_cockney - * - * @covers ::wptexturize */ public function test_cockney( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1099,8 +1032,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_smart_dashes - * - * @covers ::wptexturize */ public function test_smart_dashes( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1154,8 +1085,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 22692 * @dataProvider data_misc_static_replacements - * - * @covers ::wptexturize */ public function test_misc_static_replacements( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1211,8 +1140,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 8775 * @dataProvider data_quoted_numbers - * - * @covers ::wptexturize */ public function test_quoted_numbers( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1264,8 +1191,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 20342 * @dataProvider data_quotes_and_dashes - * - * @covers ::wptexturize */ public function test_quotes_and_dashes( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1329,8 +1254,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 12690 * @dataProvider data_tag_avoidance - * - * @covers ::wptexturize */ public function test_tag_avoidance( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1554,8 +1477,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 26850 * @dataProvider data_year_abbr - * - * @covers ::wptexturize */ public function test_year_abbr( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1645,8 +1566,6 @@ 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 ); @@ -1874,8 +1793,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 28483 * @dataProvider data_element_stack - * - * @covers ::wptexturize */ public function test_element_stack( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -1927,8 +1844,6 @@ 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 ); @@ -2014,8 +1929,6 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { * * @ticket 29256 * @dataProvider data_primes_vs_quotes - * - * @covers ::wptexturize */ public function test_primes_vs_quotes( $input, $output ) { $this->assertSame( $output, wptexturize( $input ) ); @@ -2078,8 +1991,6 @@ 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 ); @@ -2196,8 +2107,6 @@ 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 ) );