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

    r51628 r52010  
    4949    }
    5050
    51     function test_prepend_each_line() {
     51    public function test_prepend_each_line() {
    5252        $po = new PO();
    5353        $this->assertSame( 'baba_', $po->prepend_each_line( '', 'baba_' ) );
     
    5656    }
    5757
    58     function test_poify() {
     58    public function test_poify() {
    5959        $po = new PO();
    6060        // Simple.
     
    7575    }
    7676
    77     function test_unpoify() {
     77    public function test_unpoify() {
    7878        $po = new PO();
    7979        $this->assertSame( 'baba', $po->unpoify( '"baba"' ) );
     
    8686    }
    8787
    88     function test_export_entry() {
     88    public function test_export_entry() {
    8989        $po    = new PO();
    9090        $entry = new Translation_Entry( array( 'singular' => 'baba' ) );
     
    211211    }
    212212
    213     function test_export_entries() {
     213    public function test_export_entries() {
    214214        $entry  = new Translation_Entry( array( 'singular' => 'baba' ) );
    215215        $entry2 = new Translation_Entry( array( 'singular' => 'dyado' ) );
     
    220220    }
    221221
    222     function test_export_headers() {
     222    public function test_export_headers() {
    223223        $po = new PO();
    224224        $po->set_header( 'Project-Id-Version', 'WordPress 2.6-bleeding' );
     
    227227    }
    228228
    229     function test_export() {
     229    public function test_export() {
    230230        $po     = new PO();
    231231        $entry  = new Translation_Entry( array( 'singular' => 'baba' ) );
     
    240240
    241241
    242     function test_export_to_file() {
     242    public function test_export_to_file() {
    243243        $po     = new PO();
    244244        $entry  = new Translation_Entry( array( 'singular' => 'baba' ) );
     
    258258    }
    259259
    260     function test_import_from_file() {
     260    public function test_import_from_file() {
    261261        $po  = new PO();
    262262        $res = $po->import_from_file( DIR_TESTDATA . '/pomo/simple.po' );
     
    317317    }
    318318
    319     function test_import_from_entry_file_should_give_false() {
     319    public function test_import_from_entry_file_should_give_false() {
    320320        $po = new PO();
    321321        $this->assertFalse( $po->import_from_file( DIR_TESTDATA . '/pomo/empty.po' ) );
    322322    }
    323323
    324     function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
     324    public function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
    325325        $po = new PO();
    326326        $this->assertTrue( $po->import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) );
Note: See TracChangeset for help on using the changeset viewer.