From ade2dd5dfecd364dd3145b676208cb41897a6b6b Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 18 Jan 2018 05:14:28 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/functions/listFilter.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/phpunit/tests/functions/listFilter.php b/tests/phpunit/tests/functions/listFilter.php index 9be0a460a0..364b31d99d 100644 --- a/tests/phpunit/tests/functions/listFilter.php +++ b/tests/phpunit/tests/functions/listFilter.php @@ -83,7 +83,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase { 'field2' => true, ), 'AND', 'name' ); - $this->assertEquals( 2, count( $list ) ); $this->assertEquals( array( 'foo' => 'foo', @@ -99,7 +98,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase { 'field3' => true, ), 'OR', 'name' ); - $this->assertEquals( 2, count( $list ) ); $this->assertEquals( array( 'foo' => 'foo', @@ -115,7 +113,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase { 'field3' => true, ), 'NOT', 'name' ); - $this->assertEquals( 1, count( $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() { $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 ); } function test_filter_object_list_nested_array_not_field() { $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' ); - $this->assertEquals( 2, count( $list ) ); $this->assertEquals( array( 'foo' => 'foo', @@ -269,7 +264,6 @@ class Tests_Functions_ListFilter extends WP_UnitTestCase { 'field4' => array( 'blue' ), ), 'OR', 'name' ); - $this->assertEquals( 2, count( $list ) ); $this->assertEquals( array( 'foo' => 'foo',