WordPress.org

Make WordPress Core

Changeset 1177 in tests


Ignore:
Timestamp:
12/27/12 15:46:15 (16 months ago)
Author:
nacin
Message:

Test that get_post_ancestors() returns an empty array when passed a value that evaluates to false. see #22882.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post/objects.php

    r1086 r1177  
    8989    } 
    9090 
     91    /** 
     92     * @ticket 22882 
     93     */ 
     94    function test_get_post_ancestors_with_falsey_values() { 
     95        foreach ( array( null, 0, false, '0', '' ) as $post_id ) { 
     96            $this->assertInternalType( 'array', get_post_ancestors( $post_id ) ); 
     97            $this->assertEquals( array(), get_post_ancestors( $post_id ) ); 
     98        } 
     99    } 
     100 
    91101    function test_get_post_category_property() { 
    92102        $post_id = $this->factory->post->create(); 
Note: See TracChangeset for help on using the changeset viewer.