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/term/getEditTermLink.php

    r35225 r35242  
    77    public function setUp() {
    88        parent::setUp();
    9         wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     9        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    1010        register_taxonomy( 'wptests_tax', 'post' );
    1111    }
    1212
    1313    public function test_get_edit_term_link_default() {
    14         $term1 = self::$factory->term->create( array(
     14        $term1 = self::factory()->term->create( array(
    1515            'taxonomy' => 'wptests_tax',
    1616            'name' => 'foo',
     
    2626     */
    2727    public function test_get_edit_term_link_invalid_id() {
    28         $term1 = self::$factory->term->create( array(
     28        $term1 = self::factory()->term->create( array(
    2929            'taxonomy' => 'wptests_tax',
    3030            'name' => 'foo',
Note: See TracChangeset for help on using the changeset viewer.