Make WordPress Core


Ignore:
Timestamp:
02/03/2015 02:28:52 AM (9 years ago)
Author:
SergeyBiryukov
Message:

When using WP_Query's 'fields' => 'ids' (or 'fields' => 'id=>parent'), make sure the returned result is always an array of integers.

fixes #31194. see #27252.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/results.php

    r30524 r31324  
    388388    /**
    389389     * @ticket 27252
     390     * @ticket 31194
    390391     */
    391392    function test_query_fields_integers() {
     
    402403
    403404        $this->assertSame( $parents, $posts1 );
     405        $this->assertSame( $parents, $this->q->posts );
    404406
    405407        $children = array(
     
    415417
    416418        $this->assertSame( $children, $posts2 );
     419
     420        foreach ( $this->q->posts as $post ) {
     421            $this->assertInternalType( 'int', $post->ID );
     422            $this->assertInternalType( 'int', $post->post_parent );
     423        }
    417424
    418425    }
Note: See TracChangeset for help on using the changeset viewer.