Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (4 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/feed/rss2.php

    r51651 r52010  
    7979     * This is a bit of a hack used to buffer feed content.
    8080     */
    81     function do_rss2() {
     81    private function do_rss2() {
    8282        ob_start();
    8383        // Nasty hack! In the future it would better to leverage do_feed( 'rss2' ).
     
    9898     * with the expected child elements and attributes.
    9999     */
    100     function test_rss_element() {
     100    public function test_rss_element() {
    101101        $this->go_to( '/?feed=rss2' );
    102102        $feed = $this->do_rss2();
     
    123123     * @return [type] [description]
    124124     */
    125     function test_channel_element() {
     125    public function test_channel_element() {
    126126        $this->go_to( '/?feed=rss2' );
    127127        $feed = $this->do_rss2();
     
    153153     * @ticket 39141
    154154     */
    155     function test_channel_pubdate_element_translated() {
     155    public function test_channel_pubdate_element_translated() {
    156156        $original_locale = $GLOBALS['wp_locale'];
    157157        /* @var WP_Locale $locale */
     
    176176    }
    177177
    178     function test_item_elements() {
     178    public function test_item_elements() {
    179179        $this->go_to( '/?feed=rss2' );
    180180        $feed = $this->do_rss2();
     
    267267     * @ticket 9134
    268268     */
    269     function test_items_comments_closed() {
     269    public function test_items_comments_closed() {
    270270        add_filter( 'comments_open', '__return_false' );
    271271
     
    302302     * @ticket 30210
    303303     */
    304     function test_valid_home_feed_endpoint() {
     304    public function test_valid_home_feed_endpoint() {
    305305        // An example of a valid home feed endpoint.
    306306        $this->go_to( 'feed/' );
     
    330330     * @ticket 30210
    331331     */
    332     function test_valid_taxonomy_feed_endpoint() {
     332    public function test_valid_taxonomy_feed_endpoint() {
    333333        // An example of an valid taxonomy feed endpoint.
    334334        $this->go_to( 'category/foo/feed/' );
     
    358358     * @ticket 30210
    359359     */
    360     function test_valid_main_comment_feed_endpoint() {
     360    public function test_valid_main_comment_feed_endpoint() {
    361361        // Generate a bunch of comments.
    362362        foreach ( self::$posts as $post ) {
     
    391391     * @ticket 30210
    392392     */
    393     function test_valid_archive_feed_endpoint() {
     393    public function test_valid_archive_feed_endpoint() {
    394394        // An example of an valid date archive feed endpoint.
    395395        $this->go_to( '2003/05/27/feed/' );
     
    419419     * @ticket 30210
    420420     */
    421     function test_valid_single_post_comment_feed_endpoint() {
     421    public function test_valid_single_post_comment_feed_endpoint() {
    422422        // An example of an valid date archive feed endpoint.
    423423        $this->go_to( get_post_comments_feed_link( self::$posts[0] ) );
     
    447447     * @ticket 30210
    448448     */
    449     function test_valid_search_feed_endpoint() {
     449    public function test_valid_search_feed_endpoint() {
    450450        // An example of an valid search feed endpoint.
    451451        $this->go_to( '?s=Lorem&feed=rss' );
Note: See TracChangeset for help on using the changeset viewer.