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/ajax/GetComments.php

    r35225 r35242  
    3333    public function setUp() {
    3434        parent::setUp();
    35         $post_id = self::$factory->post->create();
    36         self::$factory->comment->create_post_comments( $post_id, 5 );
     35        $post_id = self::factory()->post->create();
     36        self::factory()->comment->create_post_comments( $post_id, 5 );
    3737        $this->_comment_post = get_post( $post_id );
    3838
    39         $post_id = self::$factory->post->create();
     39        $post_id = self::factory()->post->create();
    4040        $this->_no_comment_post = get_post( $post_id );
    4141
Note: See TracChangeset for help on using the changeset viewer.