mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Reduce usage of assertEquals
Replaces assertSame with assertCount in a number of tests. Props ayeshrajans, jorbin. See #58956. git-svn-id: https://develop.svn.wordpress.org/trunk@56746 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2083,15 +2083,13 @@ class Tests_User extends WP_UnitTestCase {
|
||||
$this->assertCount( 12, $actual['data'][0]['data'] );
|
||||
|
||||
// Check that the item added by the filter was retained.
|
||||
$this->assertSame(
|
||||
$this->assertCount(
|
||||
1,
|
||||
count(
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'Test Additional Data Name',
|
||||
'value' => 'Test Additional Data Value',
|
||||
)
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'Test Additional Data Name',
|
||||
'value' => 'Test Additional Data Value',
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -2115,28 +2113,24 @@ class Tests_User extends WP_UnitTestCase {
|
||||
$this->assertCount( 12, $actual['data'][0]['data'] );
|
||||
|
||||
// Check that the duplicate 'name' => 'User ID' was stripped.
|
||||
$this->assertSame(
|
||||
$this->assertCount(
|
||||
1,
|
||||
count(
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'User ID',
|
||||
)
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'User ID',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Check that the item added by the filter was retained.
|
||||
$this->assertSame(
|
||||
$this->assertCount(
|
||||
1,
|
||||
count(
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'Test Additional Data Name',
|
||||
'value' => 'Test Additional Data Value',
|
||||
)
|
||||
wp_list_filter(
|
||||
$actual['data'][0]['data'],
|
||||
array(
|
||||
'name' => 'Test Additional Data Name',
|
||||
'value' => 'Test Additional Data Value',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user