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/post/filtering.php

    r51568 r52010  
    1111 */
    1212class Tests_Post_Filtering extends WP_UnitTestCase {
    13     function set_up() {
     13    public function set_up() {
    1414        parent::set_up();
    1515        update_option( 'use_balanceTags', 1 );
     
    1818    }
    1919
    20     function tear_down() {
     20    public function tear_down() {
    2121        kses_remove_filters();
    2222        parent::tear_down();
     
    2424
    2525    // A simple test to make sure unclosed tags are fixed.
    26     function test_post_content_unknown_tag() {
     26    public function test_post_content_unknown_tag() {
    2727
    2828        $content = <<<EOF
     
    4141
    4242    // A simple test to make sure unbalanced tags are fixed.
    43     function test_post_content_unbalanced_tag() {
     43    public function test_post_content_unbalanced_tag() {
    4444
    4545        $content = <<<EOF
     
    5858
    5959    // Test KSES filtering of disallowed attribute.
    60     function test_post_content_disallowed_attr() {
     60    public function test_post_content_disallowed_attr() {
    6161
    6262        $content = <<<EOF
     
    7979     * @ticket 12394
    8080     */
    81     function test_post_content_xhtml_empty_elem() {
     81    public function test_post_content_xhtml_empty_elem() {
    8282        $content = <<<EOF
    8383<img src='foo' width='500' height='300'/>
     
    9595
    9696    // Make sure unbalanced tags are untouched when the balance option is off.
    97     function test_post_content_nobalance_nextpage_more() {
     97    public function test_post_content_nobalance_nextpage_more() {
    9898
    9999        update_option( 'use_balanceTags', 0 );
Note: See TracChangeset for help on using the changeset viewer.