Make WordPress Core

Changeset 37261


Ignore:
Timestamp:
04/20/2016 03:30:40 PM (8 years ago)
Author:
boonebgorges
Message:

Tests: After [37260], use WP's setUpBeforeClass() wrappers.

This ensures no leakage between tests of fixture IDs.

See #36602.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/canonical/category.php

    r37260 r37261  
    1010    public static $cats = array();
    1111
    12     public static function setUpBeforeClass() {
     12    public static function wpSetUpBeforeClass( $factory ) {
    1313
    14         self::$posts[0] = self::factory()->post->create( array( 'post_name' => 'post0' ) );
    15         self::$posts[1] = self::factory()->post->create( array( 'post_name' => 'post1' ) );
    16         self::$cats[0] = self::factory()->category->create( array( 'slug' => 'cat0' ) );
    17         self::$cats[1] = self::factory()->category->create( array( 'slug' => 'cat1' ) );
    18         self::$cats[2] = self::factory()->category->create( array( 'slug' => 'cat2' ) );
     14        self::$posts[0] = $factory->post->create( array( 'post_name' => 'post0' ) );
     15        self::$posts[1] = $factory->post->create( array( 'post_name' => 'post1' ) );
     16        self::$cats[0] = $factory->category->create( array( 'slug' => 'cat0' ) );
     17        self::$cats[1] = $factory->category->create( array( 'slug' => 'cat1' ) );
     18        self::$cats[2] = $factory->category->create( array( 'slug' => 'cat2' ) );
    1919
    2020        wp_set_post_categories( self::$posts[0], self::$cats[2] );
     
    2323    }
    2424
    25     public static function tearDownAfterClass() {
     25    public static function wpTearDownAfterClass() {
    2626        foreach ( self::$posts as $post_id ) {
    2727            wp_delete_post( $post_id, true );
Note: See TracChangeset for help on using the changeset viewer.