Make WordPress Core


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

    r51568 r52010  
    55 */
    66class Tests_POMO_NOOPTranslations extends WP_UnitTestCase {
    7         function set_up() {
     7        public function set_up() {
    88                parent::set_up();
    99                $this->noop         = new NOOP_Translations;
    … …  
    1818        }
    1919
    20         function test_get_header() {
     20        public function test_get_header() {
    2121                $this->assertFalse( $this->noop->get_header( 'Content-Type' ) );
    2222        }
    2323
    24         function test_add_entry() {
     24        public function test_add_entry() {
    2525                $this->noop->add_entry( $this->entry );
    2626                $this->assertSame( array(), $this->noop->entries );
    2727        }
    2828
    29         function test_set_header() {
     29        public function test_set_header() {
    3030                $this->noop->set_header( 'header', 'value' );
    3131                $this->assertSame( array(), $this->noop->headers );
    3232        }
    3333
    34         function test_translate_entry() {
     34        public function test_translate_entry() {
    3535                $this->noop->add_entry( $this->entry );
    3636                $this->assertFalse( $this->noop->translate_entry( $this->entry ) );
    3737        }
    3838
    39         function test_translate() {
     39        public function test_translate() {
    4040                $this->noop->add_entry( $this->entry );
    4141                $this->assertSame( 'baba', $this->noop->translate( 'baba' ) );
    4242        }
    4343
    44         function test_plural() {
     44        public function test_plural() {
    4545                $this->noop->add_entry( $this->plural_entry );
    4646                $this->assertSame( 'dyado', $this->noop->translate_plural( 'dyado', 'dyados', 1 ) );
Note: See TracChangeset for help on using the changeset viewer.