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/post/getPages.php

    r51462 r52010  
    99     * @ticket 23167
    1010     */
    11     function test_get_pages_cache() {
     11    public function test_get_pages_cache() {
    1212        global $wpdb;
    1313
     
    250250     * @ticket 20376
    251251     */
    252     function test_get_pages_meta() {
     252    public function test_get_pages_meta() {
    253253        $posts = self::factory()->post->create_many( 3, array( 'post_type' => 'page' ) );
    254254        add_post_meta( $posts[0], 'some-meta-key', '0' );
     
    284284     * @ticket 22074
    285285     */
    286     function test_get_pages_include_exclude() {
     286    public function test_get_pages_include_exclude() {
    287287        $page_ids = array();
    288288
     
    310310     * @ticket 9470
    311311     */
    312     function test_get_pages_parent() {
     312    public function test_get_pages_parent() {
    313313        $page_id1 = self::factory()->post->create( array( 'post_type' => 'page' ) );
    314314        $page_id2 = self::factory()->post->create(
     
    368368     * @ticket 22389
    369369     */
    370     function test_wp_dropdown_pages() {
     370    public function test_wp_dropdown_pages() {
    371371        self::factory()->post->create_many( 5, array( 'post_type' => 'page' ) );
    372372
     
    379379     * @ticket 22208
    380380     */
    381     function test_get_chidren_fields_ids() {
     381    public function test_get_chidren_fields_ids() {
    382382        $post_id   = self::factory()->post->create();
    383383        $child_ids = self::factory()->post->create_many( 5, array( 'post_parent' => $post_id ) );
     
    395395     * @ticket 25750
    396396     */
    397     function test_get_pages_hierarchical_and_no_parent() {
     397    public function test_get_pages_hierarchical_and_no_parent() {
    398398        global $wpdb;
    399399        $page_1 = self::factory()->post->create( array( 'post_type' => 'page' ) );
     
    619619    }
    620620
    621     function test_wp_list_pages_classes() {
     621    public function test_wp_list_pages_classes() {
    622622        $type = 'taco';
    623623        register_post_type(
     
    652652    }
    653653
    654     function test_exclude_tree() {
     654    public function test_exclude_tree() {
    655655        $post_id1 = self::factory()->post->create( array( 'post_type' => 'page' ) );
    656656        $post_id2 = self::factory()->post->create(
     
    702702     * @ticket 43514
    703703     */
    704     function test_get_pages_cache_empty() {
     704    public function test_get_pages_cache_empty() {
    705705        global $wpdb;
    706706
Note: See TracChangeset for help on using the changeset viewer.