Make WordPress Core

Changeset 14 in tests


Ignore:
Timestamp:
09/20/2007 11:49:04 AM (18 years ago)
Author:
tellyworth
Message:

clean up test_vb_insert_future

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_post.php

    r13 r14  
    1414            wp_delete_post($id);
    1515    }
     16
     17    // helper function: return the timestamp(s) of cron jobs for the specified hook and post
     18    function _next_schedule_for_post($hook, $id) {
     19        return wp_next_scheduled('publish_future_post', array(0=>strval($id)));
     20    }
     21
    1622
    1723    // test simple valid behavior: insert and get a post
     
    6773        $this->assertEquals($post['post_date'], $out->post_date);
    6874
    69         $cron = _get_cron_array();
    70 
    71         $this->assertTrue(is_array($cron[$future_date]['publish_future_post']));
    72         $cron_args = array_pop($cron[$future_date]['publish_future_post']);
    73         $this->assertEquals(false, $cron_args['schedule']);
    74         $this->assertEquals(array($id), $cron_args['args']);
     75        // there should be a publish_future_post hook scheduled on the future date
     76        $this->assertEquals($future_date, $this->_next_schedule_for_post('publish_future_post', $id));
    7577    }
    7678   
    77     // helper function: return the timestamp(s) of cron jobs for the specified hook and post
    78     function _next_schedule_for_post($hook, $id) {
    79         return wp_next_scheduled('publish_future_post', array(0=>strval($id)));
    80     }
    81 
    8279    function test_vb_insert_future_edit_bug() {
    8380        // future post bug: posts get published at the wrong time if you edit the timestamp
Note: See TracChangeset for help on using the changeset viewer.