Make WordPress Core


Ignore:
Timestamp:
11/15/2020 01:59:32 PM (6 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes.

This brings consistency to this often-used method, and allows IDEs to provide help to developers when using its $factory parameter.

See #51344

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/getCommentLink.php

    r46586 r49603  
    88        protected static $comments = array();
    99
    10         public static function wpSetUpBeforeClass( $factory ) {
     10        public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    1111                $now     = time();
    12                 self::$p = self::factory()->post->create();
     12                self::$p = $factory->post->create();
    1313
    14                 self::$comments[] = self::factory()->comment->create(
     14                self::$comments[] = $factory->comment->create(
    1515                        array(
    1616                                'comment_post_ID'  => self::$p,
     
    1919                        )
    2020                );
    21                 self::$comments[] = self::factory()->comment->create(
     21                self::$comments[] = $factory->comment->create(
    2222                        array(
    2323                                'comment_post_ID'  => self::$p,
     
    2626                        )
    2727                );
    28                 self::$comments[] = self::factory()->comment->create(
     28                self::$comments[] = $factory->comment->create(
    2929                        array(
    3030                                'comment_post_ID'  => self::$p,
     
    3333                        )
    3434                );
    35                 self::$comments[] = self::factory()->comment->create(
     35                self::$comments[] = $factory->comment->create(
    3636                        array(
    3737                                'comment_post_ID'  => self::$p,
     
    4040                        )
    4141                );
    42                 self::$comments[] = self::factory()->comment->create(
     42                self::$comments[] = $factory->comment->create(
    4343                        array(
    4444                                'comment_post_ID'  => self::$p,
     
    4747                        )
    4848                );
    49                 self::$comments[] = self::factory()->comment->create(
     49                self::$comments[] = $factory->comment->create(
    5050                        array(
    5151                                'comment_post_ID'  => self::$p,
Note: See TracChangeset for help on using the changeset viewer.