Make WordPress Core


Ignore:
Timestamp:
11/15/2020 01:59:32 PM (4 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/includes/testcase-canonical.php

    r49184 r49603  
    1616    public $structure = '/%year%/%monthnum%/%day%/%postname%/';
    1717
    18     public static function wpSetUpBeforeClass( $factory ) {
     18    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    1919        self::generate_shared_fixtures( $factory );
    2020    }
     
    4242     * @since 4.1.0
    4343     */
    44     public static function generate_shared_fixtures( $factory ) {
     44    public static function generate_shared_fixtures( WP_UnitTest_Factory $factory ) {
    4545        self::$old_current_user = get_current_user_id();
    4646        self::$author_id        = $factory->user->create( array( 'user_login' => 'canonical-author' ) );
     
    5353
    5454        // Already created by install defaults:
    55         // self::factory()->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
     55        // $factory->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
    5656
    5757        self::$post_ids[] = $factory->post->create(
Note: See TracChangeset for help on using the changeset viewer.