Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (4 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/escHtml.php

    r51623 r52010  
    55 */
    66class Tests_Formatting_EscHtml extends WP_UnitTestCase {
    7     function test_esc_html_basics() {
     7    public function test_esc_html_basics() {
    88        // Simple string.
    99        $html = 'The quick brown fox.';
     
    2121    }
    2222
    23     function test_escapes_ampersands() {
     23    public function test_escapes_ampersands() {
    2424        $source = 'penn & teller & at&t';
    2525        $res    = 'penn & teller & at&t';
     
    2727    }
    2828
    29     function test_escapes_greater_and_less_than() {
     29    public function test_escapes_greater_and_less_than() {
    3030        $source = 'this > that < that <randomhtml />';
    3131        $res    = 'this &gt; that &lt; that &lt;randomhtml /&gt;';
     
    3333    }
    3434
    35     function test_ignores_existing_entities() {
     35    public function test_ignores_existing_entities() {
    3636        $source = '&#038; &#x00A3; &#x22; &amp;';
    3737        $res    = '&#038; &#xA3; &#x22; &amp;';
Note: See TracChangeset for help on using the changeset viewer.