WordPress.org

Make WordPress Core

Changeset 683 in tests


Ignore:
Timestamp:
04/12/12 19:45:46 (3 years ago)
Author:
kurtpayne
Message:

Do not enforce a specific order on meta value elements when calling get_post_meta() with $single = true. Fixes #36.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_post.php

    r677 r683  
    724724 
    725725        //Check they exists 
    726         $this->assertEquals('another value', get_post_meta($this->post_id, 'nonunique', true));      
    727         $this->assertEquals(array('another value', 'someother value'), get_post_meta($this->post_id, 'nonunique', false)); 
     726        $expected = array( 
     727            'someother value', 
     728            'another value' 
     729        ); 
     730        sort( $expected ); 
     731        $this->assertTrue( in_array( get_post_meta( $this->post_id, 'nonunique', true ), $expected ) ); 
     732        $actual = get_post_meta( $this->post_id, 'nonunique', false ); 
     733        sort( $actual ); 
     734        $this->assertEquals( $expected, $actual ); 
    728735 
    729736        //Delete the lot 
Note: See TracChangeset for help on using the changeset viewer.