Make WordPress Core

Changeset 956 in tests


Ignore:
Timestamp:
08/06/2012 02:51:14 AM (13 years ago)
Author:
nbachiyski
Message:

Don't try to setup postdata if there is no post

If before the test method there wasn't a global post, we shouldn't try
to setup the postdata, because it triggers some errors, which cause the
tests to fail if we have WP_DEBUG set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user.php

    r955 r956  
    457457        $this->assertEquals( $authordata->ID, $user_id );
    458458
    459         setup_postdata( get_post( $old_post_id ) );
     459        if ( $old_post_id )
     460            setup_postdata( get_post( $old_post_id ) );
    460461    }
    461462
Note: See TracChangeset for help on using the changeset viewer.