Make WordPress Core

Ticket #43025: 43025.test.diff

File 43025.test.diff, 695 bytes (added by jarednova, 7 years ago)

Test for patch

  • tests/phpunit/tests/functions/listFilter.php

    diff --git a/tests/phpunit/tests/functions/listFilter.php b/tests/phpunit/tests/functions/listFilter.php
    index e88d8ad..2367a89 100644
    a b class Tests_Functions_ListFilter extends WP_UnitTestCase { 
    155155                $this->assertEquals( array( 'foo' => 'foo', 'baz' => 'baz' ), $list );
    156156        }
    157157
     158        /**
     159         * @ticket 43025
     160         */
     161        function test_filter_array_object() {
     162                $ao = new ArrayObject();
     163                $ao->exchangeArray( $this->array_list );
     164                $list = wp_list_filter( $ao, array( 'id' => 'f' ) );
     165                $this->assertEquals( 1, count( $list ) );
     166                $this->assertArrayHasKey( 'foo', $list );
     167        }
     168
    158169}