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/category.php

    r51568 r52010  
    1010class Tests_Category extends WP_UnitTestCase {
    1111
    12     function tear_down() {
     12    public function tear_down() {
    1313        _unregister_taxonomy( 'test_tax_cat' );
    1414        parent::tear_down();
     
    2020     * @expectedDeprecated get_all_category_ids
    2121     */
    22     function test_get_all_category_ids() {
     22    public function test_get_all_category_ids() {
    2323        // Ccreate categories.
    2424        self::factory()->category->create_many( 2 );
     
    3636     * Validate get_category_by_slug function
    3737     */
    38     function test_get_category_by_slug() {
     38    public function test_get_category_by_slug() {
    3939
    4040        // Create test categories.
     
    6666     * Validate _make_cat_compat function
    6767     */
    68     function test__make_cat_compat() {
     68    public function test__make_cat_compat() {
    6969
    7070        // Create test categories and array representations.
     
    143143     * Validate get_cat_name function
    144144     */
    145     function test_get_cat_name() {
     145    public function test_get_cat_name() {
    146146
    147147        // Create test category.
     
    163163     * Validate get_cat_name function
    164164     */
    165     function test_get_cat_ID() {
     165    public function test_get_cat_ID() {
    166166
    167167        // Create test category.
     
    183183     * Validate get_category_by_path function
    184184     */
    185     function test_get_category_by_path() {
     185    public function test_get_category_by_path() {
    186186
    187187        // Create test categories.
Note: See TracChangeset for help on using the changeset viewer.