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/term/termCounts.php

    r51568 r52010  
    105105     * }
    106106     */
    107     function data_term_count_changes_for_post_statuses() {
     107    public function data_term_count_changes_for_post_statuses() {
    108108        return array(
    109109            // 0. Published post
     
    147147     * }
    148148     */
    149     function data_term_counts_incremented_on_publish() {
     149    public function data_term_counts_incremented_on_publish() {
    150150        return array(
    151151            // 0. Published post
     
    170170     * @param int    $change               Expected change upon publish.
    171171     */
    172     function test_term_count_transitions_update_term_counts( $original_post_status, $new_post_status, $change ) {
     172    public function test_term_count_transitions_update_term_counts( $original_post_status, $new_post_status, $change ) {
    173173        $post_id    = self::$post_ids[ $original_post_status ];
    174174        $term_count = get_term( get_option( 'default_category' ) )->count;
     
    194194     * }
    195195     */
    196     function data_term_count_transitions_update_term_counts() {
     196    public function data_term_count_transitions_update_term_counts() {
    197197        return array(
    198198            // 0. Draft -> published post
     
    225225    }
    226226
    227     function add_custom_status_to_counted_statuses( $statuses ) {
     227    public function add_custom_status_to_counted_statuses( $statuses ) {
    228228        array_push( $statuses, 'custom' );
    229229        return $statuses;
     
    270270     * }
    271271     */
    272     function data_term_count_changes_for_update_post_term_count_statuses_filter() {
     272    public function data_term_count_changes_for_update_post_term_count_statuses_filter() {
    273273        return array(
    274274            // 0. Published post
     
    320320     * }
    321321     */
    322     function data_term_count_changes_for_post_statuses_with_attachments() {
     322    public function data_term_count_changes_for_post_statuses_with_attachments() {
    323323        return array(
    324324            // 0. Published post
     
    371371     * }
    372372     */
    373     function data_term_counts_incremented_on_publish_with_attachments() {
     373    public function data_term_counts_incremented_on_publish_with_attachments() {
    374374        return array(
    375375            // 0. Published post
     
    394394     * @param int    $change               Expected change upon publish.
    395395     */
    396     function test_term_count_transitions_update_term_counts_with_attachments( $original_post_status, $new_post_status, $change ) {
     396    public function test_term_count_transitions_update_term_counts_with_attachments( $original_post_status, $new_post_status, $change ) {
    397397        $post_id = self::$post_ids[ $original_post_status ];
    398398        wp_add_object_terms( $post_id, self::$attachment_term, 'wp_test_tax_counts' );
     
    427427     * }
    428428     */
    429     function data_term_count_transitions_update_term_counts_with_attachments() {
     429    public function data_term_count_transitions_update_term_counts_with_attachments() {
    430430        return array(
    431431            // 0. Draft -> published post
     
    495495     * }
    496496     */
    497     function data_term_counts_incremented_on_publish_with_untermed_attachments() {
     497    public function data_term_counts_incremented_on_publish_with_untermed_attachments() {
    498498        return array(
    499499            // 0. Published post
     
    518518     * @param int    $change               Expected change upon publish.
    519519     */
    520     function test_term_count_transitions_update_term_counts_with_untermed_attachments( $original_post_status, $new_post_status, $change ) {
     520    public function test_term_count_transitions_update_term_counts_with_untermed_attachments( $original_post_status, $new_post_status, $change ) {
    521521        $post_id = self::$post_ids[ $original_post_status ];
    522522        wp_add_object_terms( $post_id, self::$attachment_term, 'wp_test_tax_counts' );
     
    550550     * }
    551551     */
    552     function data_term_count_transitions_update_term_counts_with_untermed_attachments() {
     552    public function data_term_count_transitions_update_term_counts_with_untermed_attachments() {
    553553        return array(
    554554            // 0. Draft -> published post
Note: See TracChangeset for help on using the changeset viewer.