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

    r35225 r35242  
    99        parent::setUp();
    1010
    11         $this->post_id = self::$factory->post->create();
     11        $this->post_id = self::factory()->post->create();
    1212    }
    1313
     
    1616     */
    1717    function test_has_children() {
    18         $comment_parent = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    19         $comment_child  = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_parent' => $comment_parent ) );
     18        $comment_parent = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
     19        $comment_child  = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_parent' => $comment_parent ) );
    2020        $comment_parent = get_comment( $comment_parent );
    2121        $comment_child  = get_comment( $comment_child  );
Note: See TracChangeset for help on using the changeset viewer.