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

@@ -421,7 +421,7 @@ class Tests_Auth extends WP_UnitTestCase {
'user_email' => "mail\'@example.com",
'user_pass' => 'password',
);
$this->factory()->user->create( $user_args );
self::factory()->user->create( $user_args );
$_POST['log'] = $user_args['user_email'];
$_POST['pwd'] = $user_args['user_pass'];
@@ -436,7 +436,7 @@ class Tests_Auth extends WP_UnitTestCase {
* @covers ::wp_validate_application_password
*/
public function test_application_password_authentication() {
$user_id = $this->factory()->user->create(
$user_id = self::factory()->user->create(
array(
'user_login' => 'http_auth_login',
'user_pass' => 'http_auth_pass', // Shouldn't be allowed for API login.