From 01ef43ace7ac947ea95b980d144a61df34df3d2a Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 20 Apr 2016 15:30:40 +0000 Subject: [PATCH] Tests: After [37260], use WP's `setUpBeforeClass()` wrappers. This ensures no leakage between tests of fixture IDs. See #36602. git-svn-id: https://develop.svn.wordpress.org/trunk@37261 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/canonical/category.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/tests/canonical/category.php b/tests/phpunit/tests/canonical/category.php index cb0363eef2..888002f6f2 100644 --- a/tests/phpunit/tests/canonical/category.php +++ b/tests/phpunit/tests/canonical/category.php @@ -9,20 +9,20 @@ class Tests_Canonical_Category extends WP_Canonical_UnitTestCase { public static $posts = array(); public static $cats = array(); - public static function setUpBeforeClass() { + public static function wpSetUpBeforeClass( $factory ) { - self::$posts[0] = self::factory()->post->create( array( 'post_name' => 'post0' ) ); - self::$posts[1] = self::factory()->post->create( array( 'post_name' => 'post1' ) ); - self::$cats[0] = self::factory()->category->create( array( 'slug' => 'cat0' ) ); - self::$cats[1] = self::factory()->category->create( array( 'slug' => 'cat1' ) ); - self::$cats[2] = self::factory()->category->create( array( 'slug' => 'cat2' ) ); + self::$posts[0] = $factory->post->create( array( 'post_name' => 'post0' ) ); + self::$posts[1] = $factory->post->create( array( 'post_name' => 'post1' ) ); + self::$cats[0] = $factory->category->create( array( 'slug' => 'cat0' ) ); + self::$cats[1] = $factory->category->create( array( 'slug' => 'cat1' ) ); + self::$cats[2] = $factory->category->create( array( 'slug' => 'cat2' ) ); wp_set_post_categories( self::$posts[0], self::$cats[2] ); wp_set_post_categories( self::$posts[0], self::$cats[0] ); wp_set_post_categories( self::$posts[1], self::$cats[1] ); } - public static function tearDownAfterClass() { + public static function wpTearDownAfterClass() { foreach ( self::$posts as $post_id ) { wp_delete_post( $post_id, true ); }