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/checkComment.php

    r35225 r35242  
    3232
    3333    public function test_should_return_true_when_comment_whitelist_is_enabled_and_author_has_approved_comment() {
    34         $post_id = self::$factory->post->create();
     34        $post_id = self::factory()->post->create();
    3535        $prev_args = array(
    3636            'comment_post_ID'      => $post_id,
     
    4040            'comment_author'       => 'BobtheBuilder',
    4141        );
    42         $prev_comment_id = self::$factory->comment->create( $prev_args );
     42        $prev_comment_id = self::factory()->comment->create( $prev_args );
    4343
    4444        update_option( 'comment_whitelist', 1 );
Note: See TracChangeset for help on using the changeset viewer.