Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (9 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/mw/editPost.php

    r35225 r35242  
    127127        // create attachment
    128128        $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
    129         $attachment_id = self::$factory->attachment->create_upload_object( $filename, $post_id );
     129        $attachment_id = self::factory()->attachment->create_upload_object( $filename, $post_id );
    130130
    131131        // add post thumbnail to post that does not have one
     
    142142
    143143        // create another attachment
    144         $attachment2_id = self::$factory->attachment->create_upload_object( $filename, $post_id );
     144        $attachment2_id = self::factory()->attachment->create_upload_object( $filename, $post_id );
    145145
    146146        // change the post's post_thumbnail
     
    229229        $editor_id = $this->make_user_by_role( 'editor' );
    230230
    231         $post_id = self::$factory->post->create( array(
     231        $post_id = self::factory()->post->create( array(
    232232            'post_author' => $editor_id
    233233        ) );
     
    252252        $editor_id = $this->make_user_by_role( 'editor' );
    253253
    254         $post_id = self::$factory->post->create( array(
     254        $post_id = self::factory()->post->create( array(
    255255            'post_title' => 'Title',
    256256            'post_author' => $editor_id,
Note: See TracChangeset for help on using the changeset viewer.