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/rewrite/oldDateRedirect.php

    r46586 r49603  
    1111    public static $attachment_id;
    1212
    13     public static function wpSetUpBeforeClass() {
    14         self::$post_id = self::factory()->post->create(
     13    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
     14        self::$post_id = $factory->post->create(
    1515            array(
    1616                'post_title' => 'Foo Bar',
     
    1919        );
    2020
    21         self::$attachment_id = self::factory()->attachment->create_object(
     21        self::$attachment_id = $factory->attachment->create_object(
    2222            array(
    2323                'file'           => DIR_TESTDATA . '/images/canola.jpg',
Note: See TracChangeset for help on using the changeset viewer.