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/pomo/mo.php

    r51415 r52010  
    66class Tests_POMO_MO extends WP_UnitTestCase {
    77
    8     function test_mo_simple() {
     8    public function test_mo_simple() {
    99        $mo = new MO();
    1010        $mo->import_from_file( DIR_TESTDATA . '/pomo/simple.mo' );
     
    2121    }
    2222
    23     function test_mo_plural() {
     23    public function test_mo_plural() {
    2424        $mo = new MO();
    2525        $mo->import_from_file( DIR_TESTDATA . '/pomo/plural.mo' );
     
    4747    }
    4848
    49     function test_mo_context() {
     49    public function test_mo_context() {
    5050        $mo = new MO();
    5151        $mo->import_from_file( DIR_TESTDATA . '/pomo/context.mo' );
     
    7474    }
    7575
    76     function test_translations_merge() {
     76    public function test_translations_merge() {
    7777        $host = new Translations();
    7878        $host->add_entry( new Translation_Entry( array( 'singular' => 'pink' ) ) );
     
    8686    }
    8787
    88     function test_export_mo_file() {
     88    public function test_export_mo_file() {
    8989        $entries              = array();
    9090        $entries[]            = new Translation_Entry(
     
    144144    }
    145145
    146     function test_export_should_not_include_empty_translations() {
     146    public function test_export_should_not_include_empty_translations() {
    147147        $entries = array();
    148148        $mo      = new MO;
     
    163163    }
    164164
    165     function test_nplurals_with_backslashn() {
     165    public function test_nplurals_with_backslashn() {
    166166        $mo = new MO();
    167167        $mo->import_from_file( DIR_TESTDATA . '/pomo/bad_nplurals.mo' );
     
    171171    }
    172172
    173     function disabled_test_performance() {
     173    public function disabled_test_performance() {
    174174        $start = microtime( true );
    175175        $mo    = new MO();
     
    178178    }
    179179
    180     function test_overloaded_mb_functions() {
     180    public function test_overloaded_mb_functions() {
    181181        if ( ( ini_get( 'mbstring.func_overload' ) & 2 ) === 0 ) {
    182182            $this->markTestSkipped( 'This test requires mbstring.func_overload to be enabled.' );
     
    188188    }
    189189
    190     function test_load_pot_file() {
     190    public function test_load_pot_file() {
    191191        $mo = new MO();
    192192        $this->assertFalse( $mo->import_from_file( DIR_TESTDATA . '/pomo/mo.pot' ) );
Note: See TracChangeset for help on using the changeset viewer.