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/query/isTerm.php

    r35225 r35242  
    3838        flush_rewrite_rules();
    3939
    40         $this->tag_id = self::$factory->tag->create( array( 'slug' => 'tag-slug' ) );
    41         $this->cat_id = self::$factory->category->create( array( 'slug' => 'cat-slug' ) );
    42         $this->tax_id = self::$factory->term->create( array( 'taxonomy' => 'testtax', 'slug' => 'tax-slug' ) );
    43         $this->tax_id2 = self::$factory->term->create( array( 'taxonomy' => 'testtax', 'slug' => 'tax-slug2' ) );
    44         $this->post_id = self::$factory->post->create();
     40        $this->tag_id = self::factory()->tag->create( array( 'slug' => 'tag-slug' ) );
     41        $this->cat_id = self::factory()->category->create( array( 'slug' => 'cat-slug' ) );
     42        $this->tax_id = self::factory()->term->create( array( 'taxonomy' => 'testtax', 'slug' => 'tax-slug' ) );
     43        $this->tax_id2 = self::factory()->term->create( array( 'taxonomy' => 'testtax', 'slug' => 'tax-slug2' ) );
     44        $this->post_id = self::factory()->post->create();
    4545        wp_set_object_terms( $this->post_id, $this->cat_id, 'category' );
    4646        wp_set_object_terms( $this->post_id, array( $this->tax_id, $this->tax_id2 ), 'testtax' );
     
    246246
    247247        register_taxonomy( 'testtax2', 'post' );
    248         $testtax2_term_id = self::$factory->term->create( array(
     248        $testtax2_term_id = self::factory()->term->create( array(
    249249            'taxonomy' => 'testtax2',
    250250            'slug' => 'testtax2-slug',
Note: See TracChangeset for help on using the changeset viewer.