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/user/author.php

    r35225 r35242  
    1616        parent::setUp();
    1717
    18         $this->author_id = self::$factory->user->create( array(
     18        $this->author_id = self::factory()->user->create( array(
    1919            'role' => 'author',
    2020            'user_login' => 'test_author',
     
    3232
    3333        // insert a post and make sure the ID is ok
    34         $this->post_id = self::$factory->post->create( $post );
     34        $this->post_id = self::factory()->post->create( $post );
    3535
    3636        setup_postdata( get_post( $this->post_id ) );
     
    9191        register_post_type( 'wptests_pt' );
    9292
    93         $cpt_ids = self::$factory->post->create_many( 2, array(
     93        $cpt_ids = self::factory()->post->create_many( 2, array(
    9494            'post_author' => $this->author_id,
    9595            'post_type'   => 'wptests_pt',
     
    106106     */
    107107    public function test_get_the_author_posts_link_no_permalinks() {
    108         $author = self::$factory->user->create_and_get( array(
     108        $author = self::factory()->user->create_and_get( array(
    109109            'display_name'  => 'Foo',
    110110            'user_nicename' => 'bar'
     
    130130        $this->set_permalink_structure( '/%postname%/' );
    131131
    132         $author = self::$factory->user->create_and_get( array(
     132        $author = self::factory()->user->create_and_get( array(
    133133            'display_name'  => 'Foo',
    134134            'user_nicename' => 'bar'
Note: See TracChangeset for help on using the changeset viewer.