mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 22:54:36 +00:00
Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( in_array( ... ) )` with `assertContains()` to use native PHPUnit functionality. Follow-up to [51335], [51337], [51367], [51397], [51403]. Props hellofromTonya, jrf, SergeyBiryukov. Fixes #53123. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51404 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1113,7 +1113,7 @@ class Tests_User extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) );
|
||||
$this->assertContains( (string) self::$contrib_id, $users );
|
||||
}
|
||||
|
||||
public function test_search_users_url() {
|
||||
@@ -1124,7 +1124,7 @@ class Tests_User extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) );
|
||||
$this->assertContains( (string) self::$contrib_id, $users );
|
||||
}
|
||||
|
||||
public function test_search_users_email() {
|
||||
@@ -1135,7 +1135,7 @@ class Tests_User extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) );
|
||||
$this->assertContains( (string) self::$contrib_id, $users );
|
||||
}
|
||||
|
||||
public function test_search_users_nicename() {
|
||||
@@ -1146,7 +1146,7 @@ class Tests_User extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) );
|
||||
$this->assertContains( (string) self::$contrib_id, $users );
|
||||
}
|
||||
|
||||
public function test_search_users_display_name() {
|
||||
@@ -1157,7 +1157,7 @@ class Tests_User extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) );
|
||||
$this->assertContains( (string) self::$contrib_id, $users );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user