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/tests/blocks/block-type.php

    r48939 r49603  
    4646     * @since 5.0.0
    4747     */
    48     public static function wpSetUpBeforeClass() {
    49         self::$editor_user_id = self::factory()->user->create(
     48    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
     49        self::$editor_user_id = $factory->user->create(
    5050            array(
    5151                'role' => 'editor',
     
    5353        );
    5454
    55         self::$post_with_blocks = self::factory()->post->create(
     55        self::$post_with_blocks = $factory->post->create(
    5656            array(
    5757                'post_title'   => 'Example',
     
    6060        );
    6161
    62         self::$post_without_blocks = self::factory()->post->create(
     62        self::$post_without_blocks = $factory->post->create(
    6363            array(
    6464                'post_title'   => 'Example',
Note: See TracChangeset for help on using the changeset viewer.