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/includes/factory.php

    r35225 r35242  
    3535    public function test_term_factory_create_and_get_should_return_term_object() {
    3636        register_taxonomy( 'wptests_tax', 'post' );
    37         $term = self::$factory->term->create_and_get( array( 'taxonomy' => 'wptests_tax' ) );
     37        $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'wptests_tax' ) );
    3838        $this->assertInternalType( 'object', $term );
    3939        $this->assertNotEmpty( $term->term_id );
Note: See TracChangeset for help on using the changeset viewer.