Make WordPress Core

Changeset 42526


Ignore:
Timestamp:
01/18/2018 05:14:28 AM (7 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/listFilter.php

    r42343 r42526  
    8484            ), 'AND', 'name'
    8585        );
    86         $this->assertEquals( 2, count( $list ) );
    8786        $this->assertEquals(
    8887            array(
     
    10099            ), 'OR', 'name'
    101100        );
    102         $this->assertEquals( 2, count( $list ) );
    103101        $this->assertEquals(
    104102            array(
     
    116114            ), 'NOT', 'name'
    117115        );
    118         $this->assertEquals( 1, count( $list ) );
    119116        $this->assertEquals( array( 'baz' => 'baz' ), $list );
    120117    }
     
    248245    function test_filter_object_list_nested_array_and_field() {
    249246        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
    250         $this->assertEquals( 1, count( $list ) );
    251247        $this->assertEquals( array( 'baz' => 'baz' ), $list );
    252248    }
     
    254250    function test_filter_object_list_nested_array_not_field() {
    255251        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
    256         $this->assertEquals( 2, count( $list ) );
    257252        $this->assertEquals(
    258253            array(
     
    270265            ), 'OR', 'name'
    271266        );
    272         $this->assertEquals( 2, count( $list ) );
    273267        $this->assertEquals(
    274268            array(
Note: See TracChangeset for help on using the changeset viewer.