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/comment/query.php

    r51462 r52010  
    12851285    }
    12861286
    1287     function test_get_comments_for_post() {
     1287    public function test_get_comments_for_post() {
    12881288        $limit = 5;
    12891289
     
    13451345     * @ticket 21003
    13461346     */
    1347     function test_orderby_meta() {
     1347    public function test_orderby_meta() {
    13481348        $comment_id  = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
    13491349        $comment_id2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
     
    15971597     * @ticket 27064
    15981598     */
    1599     function test_get_comments_by_user() {
     1599    public function test_get_comments_by_user() {
    16001600        $users = self::factory()->user->create_many( 2 );
    16011601        self::factory()->comment->create(
     
    16901690     * @ticket 28434
    16911691     */
    1692     function test_fields_ids_query() {
     1692    public function test_fields_ids_query() {
    16931693        $comment_1 = self::factory()->comment->create(
    16941694            array(
     
    17261726     * @ticket 29189
    17271727     */
    1728     function test_fields_comment__in() {
     1728    public function test_fields_comment__in() {
    17291729        $comment_1 = self::factory()->comment->create(
    17301730            array(
     
    17621762     * @ticket 29189
    17631763     */
    1764     function test_fields_comment__not_in() {
     1764    public function test_fields_comment__not_in() {
    17651765        $comment_1 = self::factory()->comment->create(
    17661766            array(
     
    17981798     * @ticket 29189
    17991799     */
    1800     function test_fields_post__in() {
     1800    public function test_fields_post__in() {
    18011801        $p1 = self::factory()->post->create();
    18021802        $p2 = self::factory()->post->create();
     
    18381838     * @ticket 29189
    18391839     */
    1840     function test_fields_post__not_in() {
     1840    public function test_fields_post__not_in() {
    18411841        $p1 = self::factory()->post->create();
    18421842        $p2 = self::factory()->post->create();
     
    18781878     * @ticket 29885
    18791879     */
    1880     function test_fields_post_author__in() {
     1880    public function test_fields_post_author__in() {
    18811881        $author_id1 = 105;
    18821882        $author_id2 = 106;
     
    19211921     * @ticket 29885
    19221922     */
    1923     function test_fields_post_author__not_in() {
     1923    public function test_fields_post_author__not_in() {
    19241924        $author_id1 = 111;
    19251925        $author_id2 = 112;
     
    19641964         * @ticket 29885
    19651965         */
    1966     function test_fields_author__in() {
     1966    public function test_fields_author__in() {
    19671967        $p1 = self::factory()->post->create();
    19681968        $p2 = self::factory()->post->create();
     
    20122012         * @ticket 29885
    20132013         */
    2014     function test_fields_author__not_in() {
     2014    public function test_fields_author__not_in() {
    20152015        $p1 = self::factory()->post->create();
    20162016        $p2 = self::factory()->post->create();
Note: See TracChangeset for help on using the changeset viewer.