mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 14:14:36 +00:00
Tests: Use the factory method instead of the property.
This replaces all references to the `WP_UnitTestCase_Base::$factory` property with static function calls to the `WP_UnitTestCase_Base::factory()` method. This is a consistency improvement for the test suite. Follow up to [35225], [35242], [49603], [54087], [54088]. Props jrf. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -644,19 +644,19 @@ class Tests_Query extends WP_UnitTestCase {
|
||||
register_taxonomy( 'tax1', 'post' );
|
||||
register_taxonomy( 'tax2', 'post' );
|
||||
|
||||
$term1 = $this->factory->term->create(
|
||||
$term1 = self::factory()->term->create(
|
||||
array(
|
||||
'taxonomy' => 'tax1',
|
||||
'name' => 'term1',
|
||||
)
|
||||
);
|
||||
$term2 = $this->factory->term->create(
|
||||
$term2 = self::factory()->term->create(
|
||||
array(
|
||||
'taxonomy' => 'tax2',
|
||||
'name' => 'term2',
|
||||
)
|
||||
);
|
||||
$post_id = $this->factory->post->create();
|
||||
$post_id = self::factory()->post->create();
|
||||
wp_set_object_terms( $post_id, 'term1', 'tax1' );
|
||||
wp_set_object_terms( $post_id, 'term2', 'tax2' );
|
||||
|
||||
@@ -674,19 +674,19 @@ class Tests_Query extends WP_UnitTestCase {
|
||||
register_taxonomy( 'tax1', 'post' );
|
||||
register_taxonomy( 'tax2', 'post' );
|
||||
|
||||
$term1 = $this->factory->term->create(
|
||||
$term1 = self::factory()->term->create(
|
||||
array(
|
||||
'taxonomy' => 'tax1',
|
||||
'name' => 'term1',
|
||||
)
|
||||
);
|
||||
$term2 = $this->factory->term->create(
|
||||
$term2 = self::factory()->term->create(
|
||||
array(
|
||||
'taxonomy' => 'tax2',
|
||||
'name' => 'term2',
|
||||
)
|
||||
);
|
||||
$post_id = $this->factory->post->create();
|
||||
$post_id = self::factory()->post->create();
|
||||
wp_set_object_terms( $post_id, 'term1', 'tax1' );
|
||||
wp_set_object_terms( $post_id, 'term2', 'tax2' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user