WordPress.org

Make WordPress Core

Changeset 508 in tests


Ignore:
Timestamp:
02/01/12 22:33:55 (4 years ago)
Author:
convissor
Message:

Check return values first: avoiding messier comparisons in one case and a "Creating default object from empty value" PHP 5.4 error in another.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_post_output.php

    r407 r508  
    140140    function test_the_content() { 
    141141        // permalink page 
     142        $link = '/2008/04/01/simple-gallery-test/'; 
    142143        $this->http('/2008/04/01/simple-gallery-test/'); 
    143144        the_post(); 
    144145        // filtered output 
    145146        $out = get_echo('the_content'); 
     147        $this->assertNotEmpty($out, "Could not get the_content for $link."); 
    146148 
    147149        $expected = <<<EOF 
     
    210212        $id = 575; 
    211213        $post = get_post($id); 
     214        $this->assertNotNull($post, "get_post($id) could not find the post."); 
    212215        $post->post_content = '[gallery columns="1" size="medium"]'; 
    213216        wp_update_post($post); 
Note: See TracChangeset for help on using the changeset viewer.