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

    r51657 r52010  
    1616        }
    1717
    18         function set_up() {
     18        public function set_up() {
    1919                parent::set_up();
    2020                $this->post_type = rand_str( 20 );
     
    2727         * @ticket 16215
    2828         */
    29         function test_revision_restore_updates_edit_last_post_meta() {
     29        public function test_revision_restore_updates_edit_last_post_meta() {
    3030                // Create a post as Author.
    3131                wp_set_current_user( self::$author_user_id );
     
    7070         * @ticket 9843
    7171         */
    72         function test_revision_dont_save_revision_if_unchanged() {
     72        public function test_revision_dont_save_revision_if_unchanged() {
    7373                $post    = get_default_post_to_edit( 'post', true );
    7474                $post_id = $post->ID;
     
    140140         * @ticket 9843
    141141         */
    142         function test_revision_force_save_revision_even_if_unchanged() {
     142        public function test_revision_force_save_revision_even_if_unchanged() {
    143143                add_filter( 'wp_save_post_revision_check_for_changes', '__return_false' );
    144144
     
    215215         * @ticket 16847
    216216         */
    217         function test_revision_view_caps_post() {
     217        public function test_revision_view_caps_post() {
    218218                $post_id = self::factory()->post->create(
    219219                        array(
     
    248248         * @ticket 16847
    249249         */
    250         function test_revision_restore_caps_post() {
     250        public function test_revision_restore_caps_post() {
    251251                $post_id = self::factory()->post->create(
    252252                        array(
     
    279279         * @ticket 16847
    280280         */
    281         function test_revision_diff_caps_post() {
     281        public function test_revision_diff_caps_post() {
    282282                $post_id = self::factory()->post->create(
    283283                        array(
     
    317317         * @ticket 16847
    318318         */
    319         function test_revision_view_caps_cpt() {
     319        public function test_revision_view_caps_cpt() {
    320320                register_post_type(
    321321                        $this->post_type,
     
    359359         * @ticket 16847
    360360         */
    361         function test_revision_restore_caps_cpt() {
     361        public function test_revision_restore_caps_cpt() {
    362362                register_post_type(
    363363                        $this->post_type,
     
    405405         * @ticket 16847
    406406         */
    407         function test_revision_restore_caps_before_publish() {
     407        public function test_revision_restore_caps_before_publish() {
    408408                register_post_type(
    409409                        $this->post_type,
     
    465465         * @ticket 16847
    466466         */
    467         function test_revision_diff_caps_cpt() {
     467        public function test_revision_diff_caps_cpt() {
    468468                register_post_type(
    469469                        $this->post_type,
     
    510510         * @ticket 26042
    511511         */
    512         function test_wp_get_post_revisions_should_order_by_post_date() {
     512        public function test_wp_get_post_revisions_should_order_by_post_date() {
    513513                global $wpdb;
    514514
     
    546546         * @ticket 26042
    547547         */
    548         function test_wp_get_post_revisions_should_order_by_ID_when_post_date_matches() {
     548        public function test_wp_get_post_revisions_should_order_by_ID_when_post_date_matches() {
    549549                $post = self::factory()->post->create_and_get(
    550550                        array(
Note: See TracChangeset for help on using the changeset viewer.