Tests: Remove redundant `assertEquals()` calls in listFilter tests.
As these tests are already validating that two arrays match, checking that the counts also match before is redundant and makes it harder to debug when the test fails. See #16895 git-svn-id: https://develop.svn.wordpress.org/trunk@42526 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0baa8ae85c
commit
ade2dd5dfe
|
@ -83,7 +83,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase {
|
||||||
'field2' => true,
|
'field2' => true,
|
||||||
), 'AND', 'name'
|
), 'AND', 'name'
|
||||||
);
|
);
|
||||||
$this->assertEquals( 2, count( $list ) );
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
'foo' => 'foo',
|
'foo' => 'foo',
|
||||||
|
@ -99,7 +98,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase {
|
||||||
'field3' => true,
|
'field3' => true,
|
||||||
), 'OR', 'name'
|
), 'OR', 'name'
|
||||||
);
|
);
|
||||||
$this->assertEquals( 2, count( $list ) );
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
'foo' => 'foo',
|
'foo' => 'foo',
|
||||||
|
@ -115,7 +113,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase {
|
||||||
'field3' => true,
|
'field3' => true,
|
||||||
), 'NOT', 'name'
|
), 'NOT', 'name'
|
||||||
);
|
);
|
||||||
$this->assertEquals( 1, count( $list ) );
|
|
||||||
$this->assertEquals( array( 'baz' => 'baz' ), $list );
|
$this->assertEquals( array( 'baz' => 'baz' ), $list );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,13 +244,11 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase {
|
||||||
|
|
||||||
function test_filter_object_list_nested_array_and_field() {
|
function test_filter_object_list_nested_array_and_field() {
|
||||||
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
|
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
|
||||||
$this->assertEquals( 1, count( $list ) );
|
|
||||||
$this->assertEquals( array( 'baz' => 'baz' ), $list );
|
$this->assertEquals( array( 'baz' => 'baz' ), $list );
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_filter_object_list_nested_array_not_field() {
|
function test_filter_object_list_nested_array_not_field() {
|
||||||
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
|
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
|
||||||
$this->assertEquals( 2, count( $list ) );
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
'foo' => 'foo',
|
'foo' => 'foo',
|
||||||
|
@ -269,7 +264,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase {
|
||||||
'field4' => array( 'blue' ),
|
'field4' => array( 'blue' ),
|
||||||
), 'OR', 'name'
|
), 'OR', 'name'
|
||||||
);
|
);
|
||||||
$this->assertEquals( 2, count( $list ) );
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
'foo' => 'foo',
|
'foo' => 'foo',
|
||||||
|
|
Loading…
Reference in New Issue