Make WordPress Core

Ticket #35087: 35087.2.diff

File 35087.2.diff, 938 bytes (added by swissspidy, 8 years ago)
  • tests/phpunit/tests/functions/listFilter.php

    diff --git tests/phpunit/tests/functions/listFilter.php tests/phpunit/tests/functions/listFilter.php
    index 9fe640a..6532f97 100644
    class Tests_Functions_ListFilter extends WP_UnitTestCase { 
    110110                $this->assertEquals( array( 'f' => 'foo', 'b' => 'bar', 'z' => 'baz' ), $list );
    111111        }
    112112
     113        /**
     114         * When not being passed an array, the function should throw a warning.
     115         *
     116         * @ticket 35087
     117         * @expectedException PHPUnit_Framework_Error_Warning
     118         */
     119        function test_wp_list_pluck_non_array() {
     120                $object      = new stdClass();
     121                $object->foo = 'abc';
     122                $object->bar = 'def';
     123                wp_list_pluck( $object, 'test' );
     124        }
     125
    113126        function test_filter_object_list_nested_array_and() {
    114127                $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' );
    115128                $this->assertEquals( 1, count( $list ) );