Make WordPress Core


Ignore:
Timestamp:
06/23/2022 08:27:34 PM (4 years ago)
Author:
azaozz
Message:

Build/Test Tools, Formatting group:

  • Add and update @covers tags.
  • Add and improve docs and inline comments.

Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/wpTexturize.php

    r52010 r53562  
    55 */
    66class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
     7
     8        /**
     9         * @covers ::wptexturize
     10         */
    711        public function test_dashes() {
    812                $this->assertSame( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) );
    … …  
    1014        }
    1115
     16        /**
     17         * @covers ::wptexturize
     18         */
    1219        public function test_disable() {
    1320                $this->assertSame( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );
    … …  
    3542        /**
    3643         * @ticket 1418
     44         *
     45         * @covers ::wptexturize
    3746         */
    3847        public function test_bracketed_quotes_1418() {
    … …  
    4453        /**
    4554         * @ticket 3810
     55         *
     56         * @covers ::wptexturize
    4657         */
    4758        public function test_bracketed_quotes_3810() {
    … …  
    5162        /**
    5263         * @ticket 4539
     64         *
     65         * @covers ::wptexturize
    5366         */
    5467        public function test_basic_quotes() {
    … …  
    7487         * @ticket 4539
    7588         * @ticket 15241
     89         *
     90         * @covers ::wptexturize
    7691         */
    7792        public function test_full_sentences_with_unmatched_single_quotes() {
    … …  
    8499        /**
    85100         * @ticket 4539
     101         *
     102         * @covers ::wptexturize
    86103         */
    87104        public function test_quotes() {
    … …  
    103120        /**
    104121         * @ticket 4539
     122         *
     123         * @covers ::wptexturize
    105124         */
    106125        public function test_quotes_before_s() {
    … …  
    114133        /**
    115134         * @ticket 4539
     135         *
     136         * @covers ::wptexturize
    116137         */
    117138        public function test_quotes_before_numbers() {
    … …  
    142163        }
    143164
     165        /**
     166         * @covers ::wptexturize
     167         */
    144168        public function test_quotes_after_numbers() {
    145169                $this->assertSame( 'Class of &#8217;99', wptexturize( "Class of '99" ) );
    … …  
    149173         * @ticket 4539
    150174         * @ticket 15241
     175         *
     176         * @covers ::wptexturize
    151177         */
    152178        public function test_other_html() {
    … …  
    156182        }
    157183
     184        /**
     185         * @covers ::wptexturize
     186         */
    158187        public function test_x() {
    159188                $this->assertSame( '14&#215;24', wptexturize( '14x24' ) );
    160189        }
    161190
     191        /**
     192         * @covers ::wptexturize
     193         */
    162194        public function test_minutes_seconds() {
    163195                $this->assertSame( '9&#8242;', wptexturize( '9\'' ) );
    … …  
    173205        /**
    174206         * @ticket 8775
     207         *
     208         * @covers ::wptexturize
    175209         */
    176210        public function test_wptexturize_quotes_around_numbers() {
    … …  
    183217        /**
    184218         * @ticket 8912
     219         *
     220         * @covers ::wptexturize
    185221         */
    186222        public function test_wptexturize_html_comments() {
    … …  
    193229         * @ticket 4539
    194230         * @ticket 15241
     231         *
     232         * @covers ::wptexturize
    195233         */
    196234        public function test_entity_quote_cuddling() {
    … …  
    201239        /**
    202240         * @ticket 22823
     241         *
     242         * @covers ::wptexturize
    203243         */
    204244        public function test_apostrophes_before_primes() {
    … …  
    208248        /**
    209249         * @ticket 23185
     250         *
     251         * @covers ::wptexturize
    210252         */
    211253        public function test_spaces_around_hyphens() {
    … …  
    231273        /**
    232274         * @ticket 31030
     275         *
     276         * @covers ::wptexturize
    233277         */
    234278        public function test_hyphens_at_start_and_end() {
    … …  
    248292         *
    249293         * @ticket 22692
     294         *
     295         * @covers ::wptexturize
    250296         */
    251297        public function test_spaces_around_quotes_never() {
    … …  
    265311         * @ticket 22692
    266312         * @dataProvider data_spaces_around_quotes
     313         *
     314         * @covers ::wptexturize
    267315         */
    268316        public function test_spaces_around_quotes( $input, $output ) {
    269                 return $this->assertSame( $output, wptexturize( $input ) );
     317                $this->assertSame( $output, wptexturize( $input ) );
    270318        }
    271319
    … …  
    321369         * @ticket 22692
    322370         * @dataProvider data_apos_before_digits
     371         *
     372         * @covers ::wptexturize
    323373         */
    324374        public function test_apos_before_digits( $input, $output ) {
    325                 return $this->assertSame( $output, wptexturize( $input ) );
     375                $this->assertSame( $output, wptexturize( $input ) );
    326376        }
    327377
    … …  
    362412         * @ticket 22692
    363413         * @dataProvider data_opening_single_quote
     414         *
     415         * @covers ::wptexturize
    364416         */
    365417        public function test_opening_single_quote( $input, $output ) {
    366                 return $this->assertSame( $output, wptexturize( $input ) );
     418                $this->assertSame( $output, wptexturize( $input ) );
    367419        }
    368420
    … …  
    491543         * @ticket 22692
    492544         * @dataProvider data_double_prime
     545         *
     546         * @covers ::wptexturize
    493547         */
    494548        public function test_double_prime( $input, $output ) {
    495                 return $this->assertSame( $output, wptexturize( $input ) );
     549                $this->assertSame( $output, wptexturize( $input ) );
    496550        }
    497551
    … …  
    524578         * @ticket 22692
    525579         * @dataProvider data_single_prime
     580         *
     581         * @covers ::wptexturize
    526582         */
    527583        public function test_single_prime( $input, $output ) {
    528                 return $this->assertSame( $output, wptexturize( $input ) );
     584                $this->assertSame( $output, wptexturize( $input ) );
    529585        }
    530586
    … …  
    557613         * @ticket 22692
    558614         * @dataProvider data_contractions
     615         *
     616         * @covers ::wptexturize
    559617         */
    560618        public function test_contractions( $input, $output ) {
    561                 return $this->assertSame( $output, wptexturize( $input ) );
     619                $this->assertSame( $output, wptexturize( $input ) );
    562620        }
    563621
    … …  
    598656         * @ticket 22692
    599657         * @dataProvider data_opening_quote
     658         *
     659         * @covers ::wptexturize
    600660         */
    601661        public function test_opening_quote( $input, $output ) {
    602                 return $this->assertSame( $output, wptexturize( $input ) );
     662                $this->assertSame( $output, wptexturize( $input ) );
    603663        }
    604664
    … …  
    675735         * @ticket 22692
    676736         * @dataProvider data_closing_quote
     737         *
     738         * @covers ::wptexturize
    677739         */
    678740        public function test_closing_quote( $input, $output ) {
    679                 return $this->assertSame( $output, wptexturize( $input ) );
     741                $this->assertSame( $output, wptexturize( $input ) );
    680742        }
    681743
    … …  
    764826         * @ticket 22692
    765827         * @dataProvider data_closing_single_quote
     828         *
     829         * @covers ::wptexturize
    766830         */
    767831        public function test_closing_single_quote( $input, $output ) {
    768                 return $this->assertSame( $output, wptexturize( $input ) );
     832                $this->assertSame( $output, wptexturize( $input ) );
    769833        }
    770834
    … …  
    854918         * @ticket 30445
    855919         * @dataProvider data_multiplication
     920         *
     921         * @covers ::wptexturize
    856922         */
    857923        public function test_multiplication( $input, $output ) {
    858                 return $this->assertSame( $output, wptexturize( $input ) );
     924                $this->assertSame( $output, wptexturize( $input ) );
    859925        }
    860926
    … …  
    904970         * @ticket 22692
    905971         * @dataProvider data_ampersand
     972         *
     973         * @covers ::wptexturize
    906974         */
    907975        public function test_ampersand( $input, $output ) {
    908                 return $this->assertSame( $output, wptexturize( $input ) );
     976                $this->assertSame( $output, wptexturize( $input ) );
    909977        }
    910978
    … …  
    9691037         * @ticket 22692
    9701038         * @dataProvider data_cockney
     1039         *
     1040         * @covers ::wptexturize
    9711041         */
    9721042        public function test_cockney( $input, $output ) {
    973                 return $this->assertSame( $output, wptexturize( $input ) );
     1043                $this->assertSame( $output, wptexturize( $input ) );
    9741044        }
    9751045
    … …  
    10301100         * @ticket 22692
    10311101         * @dataProvider data_smart_dashes
     1102         *
     1103         * @covers ::wptexturize
    10321104         */
    10331105        public function test_smart_dashes( $input, $output ) {
    1034                 return $this->assertSame( $output, wptexturize( $input ) );
     1106                $this->assertSame( $output, wptexturize( $input ) );
    10351107        }
    10361108
    … …  
    10831155         * @ticket 22692
    10841156         * @dataProvider data_misc_static_replacements
     1157         *
     1158         * @covers ::wptexturize
    10851159         */
    10861160        public function test_misc_static_replacements( $input, $output ) {
    1087                 return $this->assertSame( $output, wptexturize( $input ) );
     1161                $this->assertSame( $output, wptexturize( $input ) );
    10881162        }
    10891163
    … …  
    11381212         * @ticket 8775
    11391213         * @dataProvider data_quoted_numbers
     1214         *
     1215         * @covers ::wptexturize
    11401216         */
    11411217        public function test_quoted_numbers( $input, $output ) {
    1142                 return $this->assertSame( $output, wptexturize( $input ) );
     1218                $this->assertSame( $output, wptexturize( $input ) );
    11431219        }
    11441220
    … …  
    11891265         * @ticket 20342
    11901266         * @dataProvider data_quotes_and_dashes
     1267         *
     1268         * @covers ::wptexturize
    11911269         */
    11921270        public function test_quotes_and_dashes( $input, $output ) {
    1193                 return $this->assertSame( $output, wptexturize( $input ) );
     1271                $this->assertSame( $output, wptexturize( $input ) );
    11941272        }
    11951273
    … …  
    12521330         * @ticket 12690
    12531331         * @dataProvider data_tag_avoidance
     1332         *
     1333         * @covers ::wptexturize
    12541334         */
    12551335        public function test_tag_avoidance( $input, $output ) {
    1256                 return $this->assertSame( $output, wptexturize( $input ) );
     1336                $this->assertSame( $output, wptexturize( $input ) );
    12571337        }
    12581338
    … …  
    14751555         * @ticket 26850
    14761556         * @dataProvider data_year_abbr
     1557         *
     1558         * @covers ::wptexturize
    14771559         */
    14781560        public function test_year_abbr( $input, $output ) {
    1479                 return $this->assertSame( $output, wptexturize( $input ) );
     1561                $this->assertSame( $output, wptexturize( $input ) );
    14801562        }
    14811563
    … …  
    15641646         * @ticket 27426
    15651647         * @dataProvider data_translate
     1648         *
     1649         * @covers ::wptexturize
    15661650         */
    15671651        public function test_translate( $input, $output ) {
    … …  
    15731657                wptexturize( 'reset', true );
    15741658
    1575                 return $this->assertSame( $output, $result );
     1659                $this->assertSame( $output, $result );
    15761660        }
    15771661
    … …  
    17911875         * @ticket 28483
    17921876         * @dataProvider data_element_stack
     1877         *
     1878         * @covers ::wptexturize
    17931879         */
    17941880        public function test_element_stack( $input, $output ) {
    1795                 return $this->assertSame( $output, wptexturize( $input ) );
     1881                $this->assertSame( $output, wptexturize( $input ) );
    17961882        }
    17971883
    … …  
    18421928         * @ticket 29557
    18431929         * @dataProvider data_unregistered_shortcodes
     1930         *
     1931         * @covers ::wptexturize
    18441932         */
    18451933        public function test_unregistered_shortcodes( $input, $output ) {
    … …  
    19272015         * @ticket 29256
    19282016         * @dataProvider data_primes_vs_quotes
     2017         *
     2018         * @covers ::wptexturize
    19292019         */
    19302020        public function test_primes_vs_quotes( $input, $output ) {
    1931                 return $this->assertSame( $output, wptexturize( $input ) );
     2021                $this->assertSame( $output, wptexturize( $input ) );
    19322022        }
    19332023
    … …  
    19892079         * @ticket 29256
    19902080         * @dataProvider data_primes_quotes_translation
     2081         *
     2082         * @covers ::wptexturize
    19912083         */
    19922084        public function test_primes_quotes_translation( $input, $output ) {
    … …  
    19982090                wptexturize( 'reset', true );
    19992091
    2000                 return $this->assertSame( $output, $result );
     2092                $this->assertSame( $output, $result );
    20012093        }
    20022094
    … …  
    20822174         *
    20832175         * @dataProvider data_whole_posts
     2176         *
     2177         * @covers ::preg_split
    20842178         */
    20852179        public function test_pcre_performance( $input ) {
    … …  
    21022196         *
    21032197         * @ticket 35864
     2198         *
     2199         * @covers ::wptexturize
    21042200         */
    21052201        public function test_trailing_less_than() {
Note: See TracChangeset for help on using the changeset viewer.