Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (11 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/xmlrpc/wp/editComment.php

    r35225 r35242  
    88    function test_author_can_edit_own_comment() {
    99        $author_id = $this->make_user_by_role( 'author' );
    10         $post_id = self::$factory->post->create( array(
     10        $post_id = self::factory()->post->create( array(
    1111            'post_title' => 'Post test by author',
    1212            'post_author' => $author_id
     
    3030        $this->make_user_by_role( 'author' );
    3131        $editor_id = $this->make_user_by_role( 'editor' );
    32         $post_id = self::$factory->post->create( array(
     32        $post_id = self::factory()->post->create( array(
    3333            'post_title' => 'Post test by editor',
    3434            'post_author' => $editor_id
     
    5050    function test_trash_comment() {
    5151        $this->make_user_by_role( 'administrator' );
    52         $post_id = self::$factory->post->create();
     52        $post_id = self::factory()->post->create();
    5353
    5454        $comment_data = array(
     
    7979
    8080        $this->make_user_by_role( 'administrator' );
    81         $post_id = self::$factory->post->create();
     81        $post_id = self::factory()->post->create();
    8282
    8383        $comment_data = array(
Note: See TracChangeset for help on using the changeset viewer.