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

    r51462 r52010  
    1919     * @ticket 35961
    2020     */
    21     function test_n_noop() {
     21    public function test_n_noop() {
    2222        $text_domain   = 'text-domain';
    2323        $nooped_plural = _n_noop( '%s post', '%s posts', $text_domain );
     
    3232     * @ticket 35961
    3333     */
    34     function test_nx_noop() {
     34    public function test_nx_noop() {
    3535        $text_domain   = 'text-domain';
    3636        $nooped_plural = _nx_noop( '%s post', '%s posts', 'my-context', $text_domain );
     
    4646     * @ticket 35073
    4747     */
    48     function test_before_last_bar() {
     48    public function test_before_last_bar() {
    4949        $this->assertSame( 'no-bar-at-all', before_last_bar( 'no-bar-at-all' ) );
    5050        $this->assertSame( 'before-last-bar', before_last_bar( 'before-last-bar|after-bar' ) );
     
    5555     * @ticket 35950
    5656     */
    57     function test_get_available_languages() {
     57    public function test_get_available_languages() {
    5858        $array = get_available_languages();
    5959        $this->assertIsArray( $array );
     
    6969     * @ticket 35284
    7070     */
    71     function test_wp_get_installed_translations_for_core() {
     71    public function test_wp_get_installed_translations_for_core() {
    7272        $installed_translations = wp_get_installed_translations( 'core' );
    7373        $this->assertIsArray( $installed_translations );
     
    9191     * @ticket 35294
    9292     */
    93     function test_wp_dropdown_languages() {
     93    public function test_wp_dropdown_languages() {
    9494        $args   = array(
    9595            'id'           => 'foo',
     
    113113     * @ticket 38632
    114114     */
    115     function test_wp_dropdown_languages_site_default() {
     115    public function test_wp_dropdown_languages_site_default() {
    116116        $args   = array(
    117117            'id'                       => 'foo',
     
    137137     * @ticket 44494
    138138     */
    139     function test_wp_dropdown_languages_exclude_en_us() {
     139    public function test_wp_dropdown_languages_exclude_en_us() {
    140140        $args   = array(
    141141            'id'                => 'foo',
     
    155155     * @ticket 38632
    156156     */
    157     function test_wp_dropdown_languages_en_US_selected() {
     157    public function test_wp_dropdown_languages_en_US_selected() {
    158158        $args   = array(
    159159            'id'           => 'foo',
     
    177177     * Add site default language to ja_JP in dropdown
    178178     */
    179     function test_wp_dropdown_languages_site_default_ja_JP() {
     179    public function test_wp_dropdown_languages_site_default_ja_JP() {
    180180        $args   = array(
    181181            'id'                       => 'foo',
     
    201201     * Select dropdown language from de_DE to ja_JP
    202202     */
    203     function test_wp_dropdown_languages_ja_JP_selected() {
     203    public function test_wp_dropdown_languages_ja_JP_selected() {
    204204        $args   = array(
    205205            'id'           => 'foo',
     
    225225     * @return array
    226226     */
    227     function wp_dropdown_languages_filter() {
     227    private function wp_dropdown_languages_filter() {
    228228        return array(
    229229            'de_DE' => array(
     
    248248     * @ticket 35284
    249249     */
    250     function test_wp_get_pomo_file_data() {
     250    public function test_wp_get_pomo_file_data() {
    251251        $file  = DIR_TESTDATA . '/pomo/empty.po';
    252252        $array = wp_get_pomo_file_data( $file );
     
    274274     * @ticket 44541
    275275     */
    276     function test_length_of_excerpt_should_be_counted_by_words() {
     276    public function test_length_of_excerpt_should_be_counted_by_words() {
    277277        global $post;
    278278
     
    298298     * @ticket 44541
    299299     */
    300     function test_length_of_excerpt_should_be_counted_by_chars() {
     300    public function test_length_of_excerpt_should_be_counted_by_chars() {
    301301        global $post;
    302302
     
    322322     * @ticket 44541
    323323     */
    324     function test_length_of_excerpt_should_be_counted_by_chars_in_japanese() {
     324    public function test_length_of_excerpt_should_be_counted_by_chars_in_japanese() {
    325325        global $post;
    326326
     
    346346     * @ticket 44541
    347347     */
    348     function test_length_of_excerpt_rss_should_be_counted_by_words() {
     348    public function test_length_of_excerpt_rss_should_be_counted_by_words() {
    349349        global $post;
    350350
     
    370370     * @ticket 44541
    371371     */
    372     function test_length_of_excerpt_rss_should_be_counted_by_chars() {
     372    public function test_length_of_excerpt_rss_should_be_counted_by_chars() {
    373373        global $post;
    374374
     
    395395     * @ticket 44541
    396396     */
    397     function test_length_of_draft_should_be_counted_by_words() {
     397    public function test_length_of_draft_should_be_counted_by_words() {
    398398        require_once ABSPATH . 'wp-admin/includes/dashboard.php';
    399399
     
    419419     * @ticket 44541
    420420     */
    421     function test_length_of_draft_should_be_counted_by_chars() {
     421    public function test_length_of_draft_should_be_counted_by_chars() {
    422422        require_once ABSPATH . 'wp-admin/includes/dashboard.php';
    423423
     
    443443     * @ticket 44541
    444444     */
    445     function test_length_of_draft_should_be_counted_by_chars_in_japanese() {
     445    public function test_length_of_draft_should_be_counted_by_chars_in_japanese() {
    446446        require_once ABSPATH . 'wp-admin/includes/dashboard.php';
    447447
     
    467467     * @ticket 44541
    468468     */
    469     function test_length_of_comment_excerpt_should_be_counted_by_words() {
     469    public function test_length_of_comment_excerpt_should_be_counted_by_words() {
    470470        switch_to_locale( 'en_US' );
    471471
     
    485485     * @ticket 44541
    486486     */
    487     function test_length_of_comment_excerpt_should_be_counted_by_chars() {
     487    public function test_length_of_comment_excerpt_should_be_counted_by_chars() {
    488488        switch_to_locale( 'ja_JP' );
    489489
     
    503503     * @ticket 44541
    504504     */
    505     function test_length_of_comment_excerpt_should_be_counted_by_chars_in_Japanese() {
     505    public function test_length_of_comment_excerpt_should_be_counted_by_chars_in_Japanese() {
    506506        switch_to_locale( 'ja_JP' );
    507507
Note: See TracChangeset for help on using the changeset viewer.