public function setup()
 {
     global $wp_rewrite;
     $wp_rewrite = new WP_Rewrite();
     //set the permalink structure
     $wp_rewrite->set_permalink_structure('/blog/%year%/%monthnum%/%day%/%postname%/');
     //register test post_types
     $args = array('hierarchical' => false, 'public' => true, 'has_archive' => true, 'publicly_queryable' => true, 'rewrite' => array('slug' => 'flat-posts', 'with_front' => false, 'pages' => true, 'feeds' => true), 'capability_type' => 'page');
     register_post_type('flat_post_type', $args);
     $args = array('hierarchical' => false, 'public' => true, 'has_archive' => true, 'publicly_queryable' => true, 'rewrite' => array('slug' => 'flat-posts-no-page', 'with_front' => false, 'pages' => false, 'feeds' => false), 'capability_type' => 'page');
     register_post_type('flat_no_pages', $args);
     $args = array('hierarchical' => true, 'public' => true, 'has_archive' => true, 'publicly_queryable' => true, 'rewrite' => array('slug' => 'hierarchical-posts', 'with_front' => false, 'pages' => true, 'feeds' => true), 'capability_type' => 'page');
     register_post_type('hier_post_type', $args);
 }