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:
Sergey Biryukov
2022-09-06 22:09:49 +00:00
parent 563e24ced1
commit ff56396bf3
52 changed files with 598 additions and 598 deletions

View File

@@ -244,7 +244,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_get_term_by_slug_cache() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'slug' => 'burrito',
'name' => 'Taco',
@@ -275,7 +275,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_get_term_by_slug_cache_update() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'slug' => 'burrito',
'name' => 'Taco',
@@ -313,7 +313,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_get_term_by_name_cache() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'name' => 'Burrito',
'slug' => 'noburrito',
@@ -342,7 +342,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_get_term_by_name_cache_update() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'name' => 'Burrito',
'slug' => 'noburrito',
@@ -377,7 +377,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_invalidating_term_caches_should_fail_when_invalidation_is_suspended() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'name' => 'Burrito',
'taxonomy' => 'post_tag',
@@ -420,7 +420,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
public function test_get_term_by_does_not_prime_term_meta_cache() {
global $wpdb;
$term_id = $this->factory->term->create(
$term_id = self::factory()->term->create(
array(
'name' => 'Burrito',
'taxonomy' => 'post_tag',