Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

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

    r51623 r52010  
    99     * @ticket 11008
    1010     */
    11     function test_first_post() {
     11    public function test_first_post() {
    1212        $expected  = '<p>Welcome to WordPress!  This post contains important information.  After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.</p>
    1313<p>First things first:</p>
     
    283283     * @ticket 27268
    284284     */
    285     function test_that_wpautop_treats_block_level_elements_as_blocks() {
     285    public function test_that_wpautop_treats_block_level_elements_as_blocks() {
    286286        $blocks = array(
    287287            'table',
     
    377377     * @ticket 27268
    378378     */
    379     function test_that_wpautop_does_not_wrap_blockquotes_but_does_autop_their_contents() {
     379    public function test_that_wpautop_does_not_wrap_blockquotes_but_does_autop_their_contents() {
    380380        $content  = '<blockquote>foo</blockquote>';
    381381        $expected = '<blockquote><p>foo</p></blockquote>';
     
    389389     * @ticket 27268
    390390     */
    391     function test_that_wpautop_treats_inline_elements_as_inline() {
     391    public function test_that_wpautop_treats_inline_elements_as_inline() {
    392392        $inlines = array(
    393393            'a',
     
    439439     * @dataProvider data_element_sanity
    440440     */
    441     function test_element_sanity( $input, $output ) {
     441    public function test_element_sanity( $input, $output ) {
    442442        return $this->assertSame( $output, wpautop( $input ) );
    443443    }
    444444
    445     function data_element_sanity() {
     445    public function data_element_sanity() {
    446446        return array(
    447447            array(
     
    491491     * @ticket 33377
    492492     */
    493     function test_that_wpautop_skips_line_breaks_after_br() {
     493    public function test_that_wpautop_skips_line_breaks_after_br() {
    494494        $content = '
    495495line 1<br>
     
    514514     * @ticket 33377
    515515     */
    516     function test_that_wpautop_adds_a_paragraph_after_multiple_br() {
     516    public function test_that_wpautop_adds_a_paragraph_after_multiple_br() {
    517517        $content = '
    518518line 1<br>
     
    532532     * @ticket 4857
    533533     */
    534     function test_that_text_before_blocks_is_peed() {
     534    public function test_that_text_before_blocks_is_peed() {
    535535        $content  = 'a<div>b</div>';
    536536        $expected = "<p>a</p>\n<div>b</div>";
     
    547547     * @ticket 39307
    548548     */
    549     function test_that_wpautop_does_not_add_extra_closing_p_in_figure() {
     549    public function test_that_wpautop_does_not_add_extra_closing_p_in_figure() {
    550550        $content1  = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
    551551        $expected1 = $content1;
     
    566566     * @ticket 14674
    567567     */
    568     function test_the_hr_is_not_peed() {
     568    public function test_the_hr_is_not_peed() {
    569569        $content  = 'paragraph1<hr>paragraph2';
    570570        $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>";
     
    578578     * @ticket 9437
    579579     */
    580     function test_that_wpautop_ignores_inline_svgs() {
     580    public function test_that_wpautop_ignores_inline_svgs() {
    581581        $content =
    582582            '<svg xmlns="http://www.w3.org/2000/svg">
     
    596596     * @ticket 9437
    597597     */
    598     function test_that_wpautop_ignores_inline_scripts() {
     598    public function test_that_wpautop_ignores_inline_scripts() {
    599599        $content =
    600600            '<script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.