WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (6 years ago)
Author:
wonderboymusic
Message:

Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop.

Props nerrad, wonderboymusic.
See #30017, #33968.

File:
1 edited

Legend:

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

    r35225 r35242  
    2323        // Just some dummy posts to use as parents for comments
    2424        for ( $i = 1; $i <= 2; $i++ ) {
    25             $this->posts[$i] = self::$factory->post->create();
     25            $this->posts[$i] = self::factory()->post->create();
    2626        }
    2727
     
    4040
    4141        foreach ( $comment_dates as $comment_date => $comment_parent ) {
    42             $result = self::$factory->comment->create( array(
     42            $result = self::factory()->comment->create( array(
    4343                'comment_date'    => $comment_date,
    4444                'comment_post_ID' => $this->posts[ $comment_parent ],
Note: See TracChangeset for help on using the changeset viewer.