Make WordPress Core

Changeset 66 in tests


Ignore:
Timestamp:
11/02/2007 12:17:25 AM (17 years ago)
Author:
tellyworth
Message:

add test_permlink_without_title

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_post.php

    r33 r66  
    122122    }
    123123
     124    function test_permlink_without_title() {
     125        // bug: permalink doesn't work if post title is empty
     126        // wpcom #663, also http://trac.wordpress.org/ticket/5305
     127       
     128        global $wp_rewrite;
     129        $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
    124130
     131        $post = array(
     132            'post_author' => $this->author->ID,
     133            'post_status' => 'publish',
     134            'post_content' => rand_str(),
     135            'post_title' => '',
     136            'post_date' => '2007-10-31 06:15:00',
     137        );
     138
     139        // insert a post and make sure the ID is ok
     140        $id = $this->post_ids[] = wp_insert_post($post);
     141
     142        $plink = get_permalink($id);
     143
     144        // permalink should include the post ID at the end
     145        $this->assertEquals(get_option('siteurl').'/2007/10/31/'.$id, $plink);
     146
     147        $wp_rewrite->set_permalink_structure('');
     148    }
    125149}
    126150
Note: See TracChangeset for help on using the changeset viewer.