Tests: Correctly use the factory method.

This replaces all non-static calls to the `WP_UnitTestCase_Base::factory()` method with static function calls, since the method is declared as static.

This is a consistency improvement for the test suite.

Follow up to [35225], [35242], [49603], [54087].

Props jrf.
See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@54088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-09-06 22:03:10 +00:00
parent 12f5012718
commit bfdc8eff83
38 changed files with 131 additions and 131 deletions

View File

@@ -120,7 +120,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
$this->assertNull( wp_get_custom_css_post( 'twentyten' ) );
$original_css = 'body { color: black; }';
$post_id = $this->factory()->post->create(
$post_id = self::factory()->post->create(
array(
'post_title' => $this->setting->stylesheet,
'post_name' => $this->setting->stylesheet,
@@ -130,7 +130,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
)
);
$twentyten_css = 'body { color: red; }';
$twentyten_post_id = $this->factory()->post->create(
$twentyten_post_id = self::factory()->post->create(
array(
'post_title' => 'twentyten',
'post_name' => 'twentyten',
@@ -273,7 +273,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
$this->setting->default = '/*default*/';
$this->assertSame( '/*default*//*filtered*/', $this->setting->value() );
$this->factory()->post->create(
self::factory()->post->create(
array(
'post_title' => $this->setting->stylesheet,
'post_name' => $this->setting->stylesheet,
@@ -310,7 +310,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
*/
public function test_update_filter() {
$original_css = 'body { color:red; }';
$post_id = $this->factory()->post->create(
$post_id = self::factory()->post->create(
array(
'post_title' => $this->setting->stylesheet,
'post_name' => $this->setting->stylesheet,