WordPress.org

Make WordPress Core

Changeset 323 in tests


Ignore:
Timestamp:
01/18/11 11:17:29 (3 years ago)
Author:
duck_
Message:

WXR import tests round 1

Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_import_wp.php

    r305 r323  
    22 
    33#include_once(DIR_TESTROOT.'/wp-testlib/wp-profiler.php'); 
    4 class TestImportWP extends _WPEmptyBlog { 
    5  
    6     var $posts = NULL; 
    7  
     4 
     5// need to include the importer as an external, so path may need to change... 
     6 
     7// _nuke_main_tables style function on tearDown? (Should this be part of _WPEmptyBlog tearDown?) 
     8        
     9class WXRParserTest extends WPTestCase { 
    810    function setUp() { 
    911        parent::setUp(); 
    10         include_once(ABSPATH.'/wp-admin/import/wordpress.php'); 
    11         if ( !defined('WP_IMPORTING') ) 
    12             define('WP_IMPORTING', true); 
    13  
    14 #       $this->record_queries(); 
    15  
    16  
    17 #       echo $this->_generate_post_content_test($this->posts, false); 
    18  
    19         @unlink(ABSPATH.'wp-content/uploads/2007/12/yue-04-juan_manuel_fangio.mp3'); 
    20         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg'); 
    21         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg'); 
    22         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg'); 
     12 
     13        if ( ! defined( 'WP_IMPORTING' ) ) 
     14            define( 'WP_IMPORTING', true ); 
     15             
     16        if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 
     17            define( 'WP_LOAD_IMPORTERS', true );         
     18 
     19        require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 
    2320    } 
    2421 
    2522    function tearDown() { 
    2623        parent::tearDown(); 
    27         if ($id = get_profile('ID', 'User A')) 
    28             wp_delete_user($id); 
    29         if ($id = get_profile('ID', 'User B')) 
    30             wp_delete_user($id); 
    31  
    32         @unlink(ABSPATH.'wp-content/uploads/2007/12/yue-04-juan_manuel_fangio.mp3'); 
    33         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg'); 
    34         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg'); 
    35         @unlink(ABSPATH.'wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg'); 
    36     } 
    37  
    38     function test_is_wxr_file_positive() { 
    39         $importer = new WP_Import(); 
    40         $importer->file = realpath(DIR_TESTDATA.'/export/asdftestblog1.2007-11-23.xml'); 
    41         // should return true because that's a valid export file 
    42         $result = $importer->get_entries(); 
    43         $this->assertTrue($result); 
    44     } 
    45  
    46     function test_is_wxr_file_negative() { 
    47         $importer = new WP_Import(); 
    48         $importer->file = realpath(DIR_TESTDATA.'/export/asdftestblog1.2007-11-23.sql'); 
    49         // should return false because it's not a wxr file 
    50         $result = $importer->get_entries(); 
    51         $this->assertFalse($result); 
    52     } 
    53  
    54     function test_select_authors() { 
    55  
    56         $users = get_users_of_blog(); 
    57  
    58         $importer = new WP_Import(); 
    59         $importer->file = realpath(DIR_TESTDATA.'/export/asdftestblog1.2007-11-23.xml'); 
    60  
    61         $form = get_echo(array(&$importer, 'select_authors')); 
    62         $form = mask_input_value($form); 
    63  
    64         $expected = <<<EOF 
    65 <h2>Assign Authors</h2> 
    66 <p>To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.</p> 
    67 <p>If a new user is created by WordPress, a password will be randomly generated. Manually change the user's details if necessary.</p> 
    68 <ol id="authors"><form action="?import=wordpress&amp;step=2&amp;id=" method="post"><input type="hidden" id="_wpnonce" name="_wpnonce" value="***" /><input type="hidden" name="_wp_http_referer" value="wp-test.php" /><li>Import author: <strong>Alex Shiels</strong><br />Create user  <input type="text" value="Alex Shiels" name="user_create[0]" maxlength="30"> <br /> or map to existing<input type="hidden" name="author_in[0]" value="Alex Shiels" /><select name="user_select[0]"> 
    69  
    70     <option value="0">- Select -</option> 
    71     <option value="1">{$this->author->user_login}</option>  </select> 
    72     </li><li>Import author: <strong>tellyworthtest2</strong><br />Create user  <input type="text" value="tellyworthtest2" name="user_create[1]" maxlength="30"> <br /> or map to existing<input type="hidden" name="author_in[1]" value="tellyworthtest2" /><select name="user_select[1]"> 
    73     <option value="0">- Select -</option> 
    74     <option value="1">{$this->author->user_login}</option>  </select> 
    75     </li></ol> 
    76 <h2>Import Attachments</h2> 
    77 <p> 
    78     <input type="checkbox" value="1" name="attachments" id="import-attachments" /> 
    79     <label for="import-attachments">Download and import file attachments</label> 
    80 </p> 
    81  
    82 <input type="submit" value="Submit"><br /></form> 
    83  
    84  
    85  
    86 EOF; 
    87  
    88         $this->assertEquals( strip_ws($expected), strip_ws($form) ); 
    89  
    90         // make sure the importer didn't add users yet 
    91         $this->assertEquals( $users, get_users_of_blog() ); 
    92  
    93     } 
    94  
    95     function test_big_import() { 
    96         #$this->_import_wp(DIR_TESTDATA.'/export/big-export.xml', array('User A')); 
    97         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/big-export.xml', array('User A') ) ); 
    98  
    99         // check that the tag counts are correct 
    100         $this->assertEquals(500, $this->_tag_count('Tag A')); 
    101         $this->assertEquals(500, $this->_tag_count('Tag B')); 
    102         $this->assertEquals(500, $this->_tag_count('Tag C')); 
    103  
    104         $posts = get_posts('numberposts=500&post_type=&post_status=&orderby=ID'); 
    105         $this->assertEquals( 500, count($posts) ); 
     24    } 
     25     
     26    function test_malformed_wxr() { 
     27        $file = DIR_TESTDATA . '/export/malformed.xml'; 
     28     
     29        // regex based parser cannot detect malformed XML 
     30        foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) { 
     31            $parser = new $p; 
     32            $result = $parser->parse($file); 
     33            $this->assertTrue( is_wp_error( $result ) ); 
     34            $this->assertEquals( 'There was an error when reading this WXR file', $result->get_error_message() );    
     35        }    
     36    }    
     37 
     38    function test_invalid_wxr() { 
     39        $f1 = DIR_TESTDATA . '/export/missing-version-tag.xml'; 
     40        $f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml'; 
     41     
     42        foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) { 
     43            foreach ( array( $f1, $f2 ) as $file ) { 
     44                $parser = new $p; 
     45                $result = $parser->parse( $file );               
     46                $this->assertTrue( is_wp_error( $result ) ); 
     47                $this->assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );    
     48            } 
     49        }            
     50    } 
     51     
     52    function test_wxr_version_1_1() { 
     53        $file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml'; 
     54              
     55        foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) { 
     56            $message = $p . ' failed'; 
     57            $parser = new $p; 
     58            $result = $parser->parse( $file );   
     59             
     60            $this->assertTrue( is_array( $result ), $message );          
     61            $this->assertEquals( 'http://localhost/', $result['base_url'], $message ); 
     62            $this->assertEquals( array(   
     63                'author_id' => 2, 
     64                'author_login' => 'john', 
     65                'author_email' => 'johndoe@example.org', 
     66                'author_display_name' => 'John Doe', 
     67                'author_first_name' => 'John', 
     68                'author_last_name' => 'Doe' 
     69            ), $result['authors']['john'], $message ); 
     70            $this->assertEquals( array( 
     71                'term_id' => 3, 
     72                'category_nicename' => 'alpha', 
     73                'category_parent' => '', 
     74                'cat_name' => 'alpha', 
     75                'category_description' => 'The alpha category'           
     76            ), $result['categories'][0], $message ); 
     77            $this->assertEquals( array( 
     78                'term_id' => 22, 
     79                'tag_slug' => 'clippable', 
     80                'tag_name' => 'Clippable', 
     81                'tag_description' => 'The Clippable post_tag'        
     82            ), $result['tags'][0], $message ); 
     83            $this->assertEquals( array( 
     84                'term_id' => 40, 
     85                'term_taxonomy' => 'post_tax', 
     86                'slug' => 'bieup', 
     87                'term_parent' => '',                 
     88                'term_name' => 'bieup', 
     89                'term_description' => 'The bieup post_tax'       
     90            ), $result['terms'][0], $message );                  
     91 
     92            $this->assertEquals( 2, count($result['posts']), $message ); 
     93            $this->assertEquals( 19, count($result['posts'][0]), $message ); 
     94            $this->assertEquals( 18, count($result['posts'][1]), $message ); 
     95            $this->assertEquals( array( 
     96                array( 'name' => 'alpha', 'slug' => 'alpha', 'domain' => 'category' ), 
     97                array( 'name' => 'Clippable', 'slug' => 'clippable', 'domain' => 'post_tag' ), 
     98                array( 'name' => 'bieup', 'slug' => 'bieup', 'domain' => 'post_tax' ) 
     99            ), $result['posts'][0]['terms'], $message ); 
     100            $this->assertEquals( array( 
     101                array( 'key' => '_wp_page_template', 'value' => 'default' ) 
     102            ), $result['posts'][1]['postmeta'], $message );  
     103        } 
     104    } 
     105     
     106    function test_wxr_version_1_0() { 
     107        $file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml'; 
    106108         
    107         // every post has 3 comments 
    108         foreach ($posts as $post) { 
    109             $this->assertEquals($post->comment_count, 3); 
     109        foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) { 
     110            $message = $p . ' failed'; 
     111            $parser = new $p; 
     112            $result = $parser->parse( $file ); 
     113             
     114            $this->assertTrue( is_array( $result ), $message );          
     115            $this->assertEquals( 'http://localhost/', $result['base_url'], $message ); 
     116            $this->assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message ); 
     117            $this->assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message ); 
     118            $this->assertEquals( $result['categories'][0]['category_parent'], '', $message ); 
     119            $this->assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message ); 
     120            $this->assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message ); 
     121            $this->assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );  
     122 
     123            $this->assertEquals( 6, count($result['posts']), $message ); 
     124            $this->assertEquals( 19, count($result['posts'][0]), $message ); 
     125            $this->assertEquals( 18, count($result['posts'][1]), $message ); 
     126 
     127            $this->assertEquals( array( 
     128                array( 'name' => 'Uncategorized', 'slug' => 'uncategorized', 'domain' => 'category' ) 
     129            ), $result['posts'][0]['terms'], $message ); 
     130            $this->assertEquals( array( 
     131                array( 'name' => 'alpha', 'slug' => 'alpha', 'domain' => 'category' ), 
     132                array( 'name' => 'news', 'slug' => 'news', 'domain' => 'tag' ), 
     133                array( 'name' => 'roar', 'slug' => 'roar', 'domain' => 'tag' ) 
     134            ), $result['posts'][2]['terms'], $message ); 
     135            $this->assertEquals( array( 
     136                array( 'name' => 'chicken', 'slug' => 'chicken', 'domain' => 'tag' ), 
     137                array( 'name' => 'child', 'slug' => 'child', 'domain' => 'category' ), 
     138                array( 'name' => 'face', 'slug' => 'face', 'domain' => 'tag' ) 
     139            ), $result['posts'][3]['terms'], $message ); 
     140 
     141            $this->assertEquals( array( 
     142                array( 'key' => '_wp_page_template', 'value' => 'default' ) 
     143            ), $result['posts'][1]['postmeta'], $message ); 
    110144        } 
    111145    } 
    112  
    113     function _test_dump() { 
    114         $this->_import_wp(DIR_TESTDATA.'/export/asdftestblog1.2007-11-23.xml', array('User A', 'User B')); 
    115         $this->_dump_tables('wp_posts', 'wp_postmeta', 'wp_comments', 'wp_terms', 'wp_term_taxonomy', 'wp_term_relationships', 'wp_users', 'wp_usermeta'); 
    116  
    117     } 
    118  
    119     // use this to generate the tests seen in test_all_posts() 
    120     function _test_generate() { 
    121         $this->_import_wp(DIR_TESTDATA.'/export/asdftestblog1.2008-04-01.xml', array('Alex Shiels'=>'User A', 'tellyworthtest2'=>'User B')); 
    122         $this->posts = get_posts('numberposts=500&post_type=&post_status=&orderby=post_date DESC,ID'); 
    123         echo $this->_generate_post_content_test($this->posts, false); 
    124     } 
    125  
    126     function test_all_posts() { 
    127         global $wpdb; 
    128         #$this->_import_wp(DIR_TESTDATA.'/export/asdftestblog1.2008-04-01.xml', array('Alex Shiels'=>'User A', 'tellyworthtest2'=>'User B')); 
    129         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/asdftestblog1.2007-12-14.xml', array('Alex Shiels'=>'User A', 'tellyworthtest2'=>'User B') ) ); 
    130  
    131         // check the tag and category counts 
    132         $this->assertEquals( 4, $this->_category_count('Cat A') ); 
    133         $this->assertEquals( 4, $this->_category_count('Cat B') ); 
    134         $this->assertEquals( 4, $this->_category_count('Cat C') ); 
    135         $this->assertEquals( 1, $this->_category_count('Parent') ); 
    136         $this->assertEquals( 1, $this->_category_count('Child 1') ); 
    137         $this->assertEquals( 1, $this->_category_count('Child 2') ); 
    138         $this->assertEquals( 35, $this->_category_count('Uncategorized') ); 
    139         $this->assertEquals( 4, $this->_tag_count('Tag A') ); 
    140         $this->assertEquals( 4, $this->_tag_count('Tag B') ); 
    141         $this->assertEquals( 4, $this->_tag_count('Tag C') ); 
    142  
    143         // check that the category structure is preserved 
    144         $parent = get_term_by('name', 'Parent', 'category'); 
    145         $child1 = get_term_by('name', 'Child 1', 'category'); 
    146         $child2 = get_term_by('name', 'Child 2', 'category'); 
    147         $this->assertEquals( 0, $parent->parent ); 
    148         $this->assertEquals( $parent->term_id, $child1->parent ); 
    149         $this->assertEquals( $child1->term_id, $child2->parent ); 
    150  
    151         $this->posts = get_posts('numberposts=500&post_type=&post_status=&orderby=post_date DESC,ID'); 
    152  
    153         $post = $this->posts[0]; 
    154         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    155         $this->assertEquals("2027-09-04 10:03:02", $post->post_date); 
    156         $this->assertEquals("2027-09-04 00:03:02", $post->post_date_gmt); 
    157         $this->assertEquals("September 04, 2027.", $post->post_content); 
    158         $this->assertEquals("Future post", $post->post_title); 
    159         $this->assertEquals("0", $post->post_category); 
    160         $this->assertEquals("", $post->post_excerpt); 
    161         $this->assertEquals("future", $post->post_status); 
    162         $this->assertEquals("open", $post->comment_status); 
    163         $this->assertEquals("open", $post->ping_status); 
    164         $this->assertEquals("", $post->post_password); 
    165         $this->assertEquals("future-post", $post->post_name); 
    166         $this->assertEquals("", $post->to_ping); 
    167         $this->assertEquals("", $post->pinged); 
    168         $this->assertEquals("2027-09-04 10:03:02", $post->post_modified); 
    169         $this->assertEquals("2027-09-04 00:03:02", $post->post_modified_gmt); 
    170         $this->assertEquals("", $post->post_content_filtered); 
    171         $this->assertEquals("0", $post->post_parent); 
    172         $this->assertEquals("http://asdftestblog1.wordpress.com/2027/09/04/future-post/", $post->guid); 
    173         $this->assertEquals("0", $post->menu_order); 
    174         $this->assertEquals("post", $post->post_type); 
    175         $this->assertEquals("", $post->post_mime_type); 
    176         $this->assertEquals("0", $post->comment_count); 
    177         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    178         $this->assertEquals(1, count($cats)); 
    179         $this->assertEquals('Uncategorized', $cats[0]->name); 
    180         $this->assertEquals('uncategorized', $cats[0]->slug); 
    181         $tags = wp_get_post_tags($post->ID); 
    182         $this->assertEquals(0, count($tags)); 
    183         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    184         $this->assertEquals(0, count($comments)); 
    185  
    186  
    187         $post = $this->posts[1]; 
    188         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    189         $this->assertEquals("2007-12-11 16:25:40", $post->post_date); 
    190         $this->assertEquals("2007-12-11 06:25:40", $post->post_date_gmt); 
    191         $this->assertEquals("Level 1 of the reverse hierarchy test.  This is to make sure the importer correctly assigns parents and children even when the children come first in the export file.", $post->post_content); 
    192         $this->assertEquals("Level 1", $post->post_title); 
    193         $this->assertEquals("0", $post->post_category); 
    194         $this->assertEquals("", $post->post_excerpt); 
    195         $this->assertEquals("publish", $post->post_status); 
    196         $this->assertEquals("open", $post->comment_status); 
    197         $this->assertEquals("open", $post->ping_status); 
    198         $this->assertEquals("", $post->post_password); 
    199         $this->assertEquals("level-1", $post->post_name); 
    200         $this->assertEquals("", $post->to_ping); 
    201         $this->assertEquals("", $post->pinged); 
    202         $this->assertEquals("2007-12-11 16:25:40", $post->post_modified); 
    203         $this->assertEquals("2007-12-11 06:25:40", $post->post_modified_gmt); 
    204         $this->assertEquals("", $post->post_content_filtered); 
    205         $this->assertEquals("0", $post->post_parent); 
    206         $this->assertEquals("http://asdftestblog1.wordpress.com/level-1/", $post->guid); 
    207         $this->assertEquals("0", $post->menu_order); 
    208         $this->assertEquals("page", $post->post_type); 
    209         $this->assertEquals("", $post->post_mime_type); 
    210         $this->assertEquals("0", $post->comment_count); 
    211         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    212         $this->assertEquals(1, count($cats)); 
    213         $this->assertEquals('Uncategorized', $cats[0]->name); 
    214         $this->assertEquals('uncategorized', $cats[0]->slug); 
    215         $tags = wp_get_post_tags($post->ID); 
    216         $this->assertEquals(0, count($tags)); 
    217         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    218         $this->assertEquals(0, count($comments)); 
    219  
    220  
    221         $post = $this->posts[2]; 
    222         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    223         $this->assertEquals("2007-12-11 16:23:33", $post->post_date); 
    224         $this->assertEquals("2007-12-11 06:23:33", $post->post_date_gmt); 
    225         $this->assertEquals("Level 2 of the reverse hierarchy test.", $post->post_content); 
    226         $this->assertEquals("Level 2", $post->post_title); 
    227         $this->assertEquals("0", $post->post_category); 
    228         $this->assertEquals("", $post->post_excerpt); 
    229         $this->assertEquals("publish", $post->post_status); 
    230         $this->assertEquals("open", $post->comment_status); 
    231         $this->assertEquals("open", $post->ping_status); 
    232         $this->assertEquals("", $post->post_password); 
    233         $this->assertEquals("level-2", $post->post_name); 
    234         $this->assertEquals("", $post->to_ping); 
    235         $this->assertEquals("", $post->pinged); 
    236         $this->assertEquals("2007-12-11 16:23:33", $post->post_modified); 
    237         $this->assertEquals("2007-12-11 06:23:33", $post->post_modified_gmt); 
    238         $this->assertEquals("", $post->post_content_filtered); 
    239         $this->assertEquals($this->posts[1]->ID, $post->post_parent); 
    240         $this->assertEquals("http://asdftestblog1.wordpress.com/level-2/", $post->guid); 
    241         $this->assertEquals("0", $post->menu_order); 
    242         $this->assertEquals("page", $post->post_type); 
    243         $this->assertEquals("", $post->post_mime_type); 
    244         $this->assertEquals("0", $post->comment_count); 
    245         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    246         $this->assertEquals(1, count($cats)); 
    247         $this->assertEquals('Uncategorized', $cats[0]->name); 
    248         $this->assertEquals('uncategorized', $cats[0]->slug); 
    249         $tags = wp_get_post_tags($post->ID); 
    250         $this->assertEquals(0, count($tags)); 
    251         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    252         $this->assertEquals(0, count($comments)); 
    253  
    254  
    255         $post = $this->posts[3]; 
    256         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    257         $this->assertEquals("2007-12-11 16:23:16", $post->post_date); 
    258         $this->assertEquals("2007-12-11 06:23:16", $post->post_date_gmt); 
    259         $this->assertEquals("Level 3 of the reverse hierarchy test.", $post->post_content); 
    260         $this->assertEquals("Level 3", $post->post_title); 
    261         $this->assertEquals("0", $post->post_category); 
    262         $this->assertEquals("", $post->post_excerpt); 
    263         $this->assertEquals("publish", $post->post_status); 
    264         $this->assertEquals("open", $post->comment_status); 
    265         $this->assertEquals("open", $post->ping_status); 
    266         $this->assertEquals("", $post->post_password); 
    267         $this->assertEquals("level-3", $post->post_name); 
    268         $this->assertEquals("", $post->to_ping); 
    269         $this->assertEquals("", $post->pinged); 
    270         $this->assertEquals("2007-12-11 16:23:16", $post->post_modified); 
    271         $this->assertEquals("2007-12-11 06:23:16", $post->post_modified_gmt); 
    272         $this->assertEquals("", $post->post_content_filtered); 
    273         $this->assertEquals($this->posts[2]->ID, $post->post_parent); 
    274         $this->assertEquals("http://asdftestblog1.wordpress.com/level-3/", $post->guid); 
    275         $this->assertEquals("0", $post->menu_order); 
    276         $this->assertEquals("page", $post->post_type); 
    277         $this->assertEquals("", $post->post_mime_type); 
    278         $this->assertEquals("0", $post->comment_count); 
    279         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    280         $this->assertEquals(1, count($cats)); 
    281         $this->assertEquals('Uncategorized', $cats[0]->name); 
    282         $this->assertEquals('uncategorized', $cats[0]->slug); 
    283         $tags = wp_get_post_tags($post->ID); 
    284         $this->assertEquals(0, count($tags)); 
    285         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    286         $this->assertEquals(0, count($comments)); 
    287  
    288  
    289         $post = $this->posts[4]; 
    290         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    291         $this->assertEquals("2007-12-10 19:53:13", $post->post_date); 
    292         $this->assertEquals("2007-12-10 09:53:13", $post->post_date_gmt); 
    293         $this->assertEquals("This post is in category Parent/Foo A, which clashes with the category named Foo A (no parent).", $post->post_content); 
    294         $this->assertEquals("Category name clash", $post->post_title); 
    295         $this->assertEquals("0", $post->post_category); 
    296         $this->assertEquals("", $post->post_excerpt); 
    297         $this->assertEquals("publish", $post->post_status); 
    298         $this->assertEquals("open", $post->comment_status); 
    299         $this->assertEquals("open", $post->ping_status); 
    300         $this->assertEquals("", $post->post_password); 
    301         $this->assertEquals("category-name-clash", $post->post_name); 
    302         $this->assertEquals("", $post->to_ping); 
    303         $this->assertEquals("", $post->pinged); 
    304         $this->assertEquals("2007-12-10 19:53:13", $post->post_modified); 
    305         $this->assertEquals("2007-12-10 09:53:13", $post->post_modified_gmt); 
    306         $this->assertEquals("", $post->post_content_filtered); 
    307         $this->assertEquals("0", $post->post_parent); 
    308         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/12/10/category-name-clash/", $post->guid); 
    309         $this->assertEquals("0", $post->menu_order); 
    310         $this->assertEquals("post", $post->post_type); 
    311         $this->assertEquals("", $post->post_mime_type); 
    312         $this->assertEquals("0", $post->comment_count); 
    313         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    314         $this->assertEquals(1, count($cats)); 
    315         $this->assertEquals('Foo A', $cats[0]->name); 
    316         $this->assertEquals('foo-a', $cats[0]->slug); 
    317         $tags = wp_get_post_tags($post->ID); 
    318         $this->assertEquals(0, count($tags)); 
    319         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    320         $this->assertEquals(0, count($comments)); 
    321  
    322  
    323         $post = $this->posts[5]; 
    324         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    325         $this->assertEquals("2007-12-03 08:07:28", $post->post_date); 
    326         $this->assertEquals("2007-12-02 22:07:28", $post->post_date_gmt); 
    327         $this->assertEquals("Here's an mp3 file that was uploaded as an attachment:\n\n<a href=\"http://example.com/wp-content/uploads/2007/12/yue-04-juan_manuel_fangio.mp3\" title=\"Juan Manuel Fangio by Yue\">Juan Manuel Fangio by Yue</a>\n\nAnd here's a link to an external mp3 file:\n\n<a href=\"http://generalfuzz.net/mp3/Cool%20Aberrations/acclimate.mp3\"> Acclimate by General Fuzz </a>\n\nBoth are CC licensed.", $post->post_content); 
    328         $this->assertEquals("Test with enclosures", $post->post_title); 
    329         $this->assertEquals("0", $post->post_category); 
    330         $this->assertEquals("", $post->post_excerpt); 
    331         $this->assertEquals("publish", $post->post_status); 
    332         $this->assertEquals("open", $post->comment_status); 
    333         $this->assertEquals("open", $post->ping_status); 
    334         $this->assertEquals("", $post->post_password); 
    335         $this->assertEquals("test-with-enclosures", $post->post_name); 
    336         $this->assertEquals("", $post->to_ping); 
    337         $this->assertEquals("", $post->pinged); 
    338         $this->assertEquals("2007-12-03 08:07:28", $post->post_modified); 
    339         $this->assertEquals("2007-12-02 22:07:28", $post->post_modified_gmt); 
    340         $this->assertEquals("", $post->post_content_filtered); 
    341         $this->assertEquals("0", $post->post_parent); 
    342         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/12/03/test-with-enclosures/", $post->guid); 
    343         $this->assertEquals("0", $post->menu_order); 
    344         $this->assertEquals("post", $post->post_type); 
    345         $this->assertEquals("", $post->post_mime_type); 
    346         $this->assertEquals("0", $post->comment_count); 
    347         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    348         $this->assertEquals(1, count($cats)); 
    349         $this->assertEquals('Uncategorized', $cats[0]->name); 
    350         $this->assertEquals('uncategorized', $cats[0]->slug); 
    351         $tags = wp_get_post_tags($post->ID); 
    352         $this->assertEquals(0, count($tags)); 
    353         $this->assertEquals(array ( 
    354   0 => "http://generalfuzz.net/mp3/Cool%20Aberrations/acclimate.mp3\n4800512\naudio/mpeg", 
    355   1 => "http://example.com/wp-content/uploads/2007/12/yue-04-juan_manuel_fangio.mp3\n5277824\naudio/mpeg", 
    356 ), get_post_meta($post->ID, 'enclosure', false)); 
    357         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    358         $this->assertEquals(0, count($comments)); 
    359  
    360  
    361         $post = $this->posts[6]; 
    362         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    363         $this->assertEquals("2007-12-03 07:59:03", $post->post_date); 
    364         $this->assertEquals("2007-12-02 21:59:03", $post->post_date_gmt); 
    365         $this->assertEquals("A new single from the Yue, dedicated to the legendary F1 driver. Enjoy the brand new electronic arrangement, drum'n'bass and 80's influences and the beautiful female voices of Giulia Pedroni and Sara Menozzi.\n\nLicense: Attribution-Share Alike 2.5 Generic", $post->post_content); 
    366         $this->assertEquals("Juan Manuel Fangio by Yue", $post->post_title); 
    367         $this->assertEquals("0", $post->post_category); 
    368         $this->assertEquals("", $post->post_excerpt); 
    369         $this->assertEquals("inherit", $post->post_status); 
    370         $this->assertEquals("open", $post->comment_status); 
    371         $this->assertEquals("open", $post->ping_status); 
    372         $this->assertEquals("", $post->post_password); 
    373         $this->assertEquals("juan-manuel-fangio-by-yue", $post->post_name); 
    374         $this->assertEquals("", $post->to_ping); 
    375         $this->assertEquals("", $post->pinged); 
    376         $this->assertEquals("2007-12-03 07:59:03", $post->post_modified); 
    377         $this->assertEquals("2007-12-02 21:59:03", $post->post_modified_gmt); 
    378         $this->assertEquals("", $post->post_content_filtered); 
    379         $this->assertEquals($this->posts[5]->ID, $post->post_parent); 
    380         $this->assertEquals(wp_get_attachment_url($post->ID), $post->guid); 
    381         $this->assertEquals("0", $post->menu_order); 
    382         $this->assertEquals("attachment", $post->post_type); 
    383         $this->assertEquals("audio/mpeg", $post->post_mime_type); 
    384         $this->assertEquals("0", $post->comment_count); 
    385         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    386         $this->assertEquals(1, count($cats)); 
    387         $this->assertEquals('Uncategorized', $cats[0]->name); 
    388         $this->assertEquals('uncategorized', $cats[0]->slug); 
    389         $tags = wp_get_post_tags($post->ID); 
    390         $this->assertEquals(0, count($tags)); 
    391         $this->assertEquals(array ( 
    392   0 => '/home/alex/dev/public_html/wp-content/blogs.dir/8de/1641616/files/2007/12/yue-04-juan_manuel_fangio.mp3', 
    393   1 => '/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/12/yue-04-juan_manuel_fangio.mp3', 
    394 ), get_post_meta($post->ID, '_wp_attached_file', false)); 
    395         $this->assertEquals(array ( 
    396   0 => 's:6:"a:0:{}";', 
    397   1 => 'a:0:{}', 
    398 ), get_post_meta($post->ID, '_wp_attachment_metadata', false)); 
    399         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    400         $this->assertEquals(0, count($comments)); 
    401  
    402  
    403         $post = $this->posts[7]; 
    404         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    405         $this->assertEquals("2007-11-30 13:48:59", $post->post_date); 
    406         $this->assertEquals("2007-11-30 03:48:59", $post->post_date_gmt); 
    407         $this->assertEquals("Some block quote tests:\n\n<blockquote>Here's a one line quote.</blockquote>\n\nThis part isn't quoted.  Here's a much longer quote:\n\n<blockquote> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In dapibus. In pretium pede. Donec molestie facilisis ante. Ut a turpis ut ipsum pellentesque tincidunt. Morbi blandit sapien in mauris. Nulla lectus lorem, varius aliquet, auctor vitae, bibendum et, nisl. Fusce pulvinar, risus non euismod varius, ante tortor facilisis lorem, non condimentum diam nisl vel lectus. Nullam vulputate, urna rutrum vulputate molestie, sapien dolor adipiscing nisi, eu malesuada ipsum lectus quis est. Nulla facilisi. Mauris a diam in eros pretium elementum. Vivamus lacinia nisl non orci. Duis ut dolor. Sed sollicitudin cursus libero.\n\nProin et lorem. Quisque odio. Ut gravida, pede sed convallis facilisis, magna dolor egestas dolor, non pulvinar metus magna in velit. Morbi vitae sem sit amet arcu vehicula gravida. Morbi placerat, est id pulvinar sollicitudin, ante augue vestibulum turpis, eu ultrices pede metus sit amet justo. Suspendisse metus. Mauris convallis mattis risus. Nullam et ipsum eu magna hendrerit pellentesque. Ut malesuada turpis nec orci. Donec at urna imperdiet libero tincidunt lacinia. Phasellus mollis leo pharetra velit. Quisque tortor. Nam pharetra est vel felis. Maecenas tincidunt, purus ac ultrices vehicula, ante magna ultrices orci, ac malesuada lectus purus sit amet odio. Vivamus id libero. Vivamus enim nisi, egestas aliquam, tincidunt malesuada, semper at, turpis. Vestibulum risus dolor, placerat quis, adipiscing sed, scelerisque a, enim. Vestibulum posuere.\n\nMauris felis. Vivamus ornare. Maecenas mi. Mauris quis nunc. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse potenti. In at lorem. Aliquam sed ligula eu erat ultrices congue. Aenean interdum semper purus. Phasellus eget lorem.</blockquote>\n\nAnd some trailing text.", $post->post_content); 
    408         $this->assertEquals("Block quotes", $post->post_title); 
    409         $this->assertEquals("0", $post->post_category); 
    410         $this->assertEquals("", $post->post_excerpt); 
    411         $this->assertEquals("publish", $post->post_status); 
    412         $this->assertEquals("open", $post->comment_status); 
    413         $this->assertEquals("open", $post->ping_status); 
    414         $this->assertEquals("", $post->post_password); 
    415         $this->assertEquals("block-quotes", $post->post_name); 
    416         $this->assertEquals("", $post->to_ping); 
    417         $this->assertEquals("", $post->pinged); 
    418         $this->assertEquals("2007-11-30 13:48:59", $post->post_modified); 
    419         $this->assertEquals("2007-11-30 03:48:59", $post->post_modified_gmt); 
    420         $this->assertEquals("", $post->post_content_filtered); 
    421         $this->assertEquals("0", $post->post_parent); 
    422         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/30/block-quotes/", $post->guid); 
    423         $this->assertEquals("0", $post->menu_order); 
    424         $this->assertEquals("post", $post->post_type); 
    425         $this->assertEquals("", $post->post_mime_type); 
    426         $this->assertEquals("2", $post->comment_count); 
    427         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    428         $this->assertEquals(1, count($cats)); 
    429         $this->assertEquals('Uncategorized', $cats[0]->name); 
    430         $this->assertEquals('uncategorized', $cats[0]->slug); 
    431         $tags = wp_get_post_tags($post->ID); 
    432         $this->assertEquals(0, count($tags)); 
    433         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    434         $this->assertEquals(2, count($comments)); 
    435         $this->assertEquals('Alex Shiels', $comments[0]->comment_author); 
    436         $this->assertEquals('tellyworth@gmail.com', $comments[0]->comment_author_email); 
    437         $this->assertEquals('http://flightpath.wordpress.com/', $comments[0]->comment_author_url); 
    438         $this->assertEquals('59.167.145.61', $comments[0]->comment_author_IP); 
    439         $this->assertEquals('2007-11-30 13:50:39', $comments[0]->comment_date); 
    440         $this->assertEquals('2007-11-30 03:50:39', $comments[0]->comment_date_gmt); 
    441         $this->assertEquals('0', $comments[0]->comment_karma); 
    442         $this->assertEquals('1', $comments[0]->comment_approved); 
    443         $this->assertEquals('', $comments[0]->comment_agent); 
    444         $this->assertEquals('', $comments[0]->comment_type); 
    445         $this->assertEquals('0', $comments[0]->comment_parent); 
    446         $this->assertEquals('', $comments[0]->comment_user_id); 
    447         $this->assertEquals('Alex Shiels', $comments[1]->comment_author); 
    448         $this->assertEquals('tellyworth@gmail.com', $comments[1]->comment_author_email); 
    449         $this->assertEquals('http://flightpath.wordpress.com/', $comments[1]->comment_author_url); 
    450         $this->assertEquals('59.167.145.61', $comments[1]->comment_author_IP); 
    451         $this->assertEquals('2007-11-30 13:49:59', $comments[1]->comment_date); 
    452         $this->assertEquals('2007-11-30 03:49:59', $comments[1]->comment_date_gmt); 
    453         $this->assertEquals('0', $comments[1]->comment_karma); 
    454         $this->assertEquals('1', $comments[1]->comment_approved); 
    455         $this->assertEquals('', $comments[1]->comment_agent); 
    456         $this->assertEquals('', $comments[1]->comment_type); 
    457         $this->assertEquals('0', $comments[1]->comment_parent); 
    458         $this->assertEquals('', $comments[1]->comment_user_id); 
    459  
    460  
    461         $post = $this->posts[8]; 
    462         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    463         $this->assertEquals("2007-11-24 06:19:03", $post->post_date); 
    464         $this->assertEquals("2007-11-23 20:19:03", $post->post_date_gmt); 
    465         $this->assertEquals("This post has far too many categories.", $post->post_content); 
    466         $this->assertEquals("Many categories", $post->post_title); 
    467         $this->assertEquals("0", $post->post_category); 
    468         $this->assertEquals("", $post->post_excerpt); 
    469         $this->assertEquals("publish", $post->post_status); 
    470         $this->assertEquals("open", $post->comment_status); 
    471         $this->assertEquals("open", $post->ping_status); 
    472         $this->assertEquals("", $post->post_password); 
    473         $this->assertEquals("many-categories", $post->post_name); 
    474         $this->assertEquals("", $post->to_ping); 
    475         $this->assertEquals("", $post->pinged); 
    476         $this->assertEquals("2007-11-24 06:19:03", $post->post_modified); 
    477         $this->assertEquals("2007-11-23 20:19:03", $post->post_modified_gmt); 
    478         $this->assertEquals("", $post->post_content_filtered); 
    479         $this->assertEquals("0", $post->post_parent); 
    480         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/24/many-categories/", $post->guid); 
    481         $this->assertEquals("0", $post->menu_order); 
    482         $this->assertEquals("post", $post->post_type); 
    483         $this->assertEquals("", $post->post_mime_type); 
    484         $this->assertEquals("0", $post->comment_count); 
    485         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    486         $this->assertEquals(40, count($cats)); 
    487         $this->assertEquals('aciform', $cats[0]->name); 
    488         $this->assertEquals('aciform', $cats[0]->slug); 
    489         $this->assertEquals('antiquarianism', $cats[1]->name); 
    490         $this->assertEquals('antiquarianism', $cats[1]->slug); 
    491         $this->assertEquals('arrangement', $cats[2]->name); 
    492         $this->assertEquals('arrangement', $cats[2]->slug); 
    493         $this->assertEquals('asmodeus', $cats[3]->name); 
    494         $this->assertEquals('asmodeus', $cats[3]->slug); 
    495         $this->assertEquals('broder', $cats[4]->name); 
    496         $this->assertEquals('broder', $cats[4]->slug); 
    497         $this->assertEquals('buying', $cats[5]->name); 
    498         $this->assertEquals('buying', $cats[5]->slug); 
    499         $this->assertEquals('championship', $cats[6]->name); 
    500         $this->assertEquals('championship', $cats[6]->slug); 
    501         $this->assertEquals('chastening', $cats[7]->name); 
    502         $this->assertEquals('chastening', $cats[7]->slug); 
    503         $this->assertEquals('clerkship', $cats[8]->name); 
    504         $this->assertEquals('clerkship', $cats[8]->slug); 
    505         $this->assertEquals('disinclination', $cats[9]->name); 
    506         $this->assertEquals('disinclination', $cats[9]->slug); 
    507         $this->assertEquals('disinfection', $cats[10]->name); 
    508         $this->assertEquals('disinfection', $cats[10]->slug); 
    509         $this->assertEquals('dispatch', $cats[11]->name); 
    510         $this->assertEquals('dispatch', $cats[11]->slug); 
    511         $this->assertEquals('echappee', $cats[12]->name); 
    512         $this->assertEquals('echappee', $cats[12]->slug); 
    513         $this->assertEquals('enphagy', $cats[13]->name); 
    514         $this->assertEquals('enphagy', $cats[13]->slug); 
    515         $this->assertEquals('equipollent', $cats[14]->name); 
    516         $this->assertEquals('equipollent', $cats[14]->slug); 
    517         $this->assertEquals('fatuity', $cats[15]->name); 
    518         $this->assertEquals('fatuity', $cats[15]->slug); 
    519         $this->assertEquals('gaberlunzie', $cats[16]->name); 
    520         $this->assertEquals('gaberlunzie', $cats[16]->slug); 
    521         $this->assertEquals('illtempered', $cats[17]->name); 
    522         $this->assertEquals('illtempered', $cats[17]->slug); 
    523         $this->assertEquals('insubordination', $cats[18]->name); 
    524         $this->assertEquals('insubordination', $cats[18]->slug); 
    525         $this->assertEquals('lender', $cats[19]->name); 
    526         $this->assertEquals('lender', $cats[19]->slug); 
    527         $this->assertEquals('monosyllable', $cats[20]->name); 
    528         $this->assertEquals('monosyllable', $cats[20]->slug); 
    529         $this->assertEquals('packthread', $cats[21]->name); 
    530         $this->assertEquals('packthread', $cats[21]->slug); 
    531         $this->assertEquals('palter', $cats[22]->name); 
    532         $this->assertEquals('palter', $cats[22]->slug); 
    533         $this->assertEquals('papilionaceous', $cats[23]->name); 
    534         $this->assertEquals('papilionaceous', $cats[23]->slug); 
    535         $this->assertEquals('personable', $cats[24]->name); 
    536         $this->assertEquals('personable', $cats[24]->slug); 
    537         $this->assertEquals('propylaeum', $cats[25]->name); 
    538         $this->assertEquals('propylaeum', $cats[25]->slug); 
    539         $this->assertEquals('pustule', $cats[26]->name); 
    540         $this->assertEquals('pustule', $cats[26]->slug); 
    541         $this->assertEquals('quartern', $cats[27]->name); 
    542         $this->assertEquals('quartern', $cats[27]->slug); 
    543         $this->assertEquals('scholarship', $cats[28]->name); 
    544         $this->assertEquals('scholarship', $cats[28]->slug); 
    545         $this->assertEquals('selfconvicted', $cats[29]->name); 
    546         $this->assertEquals('selfconvicted', $cats[29]->slug); 
    547         $this->assertEquals('showshoe', $cats[30]->name); 
    548         $this->assertEquals('showshoe', $cats[30]->slug); 
    549         $this->assertEquals('sloyd', $cats[31]->name); 
    550         $this->assertEquals('sloyd', $cats[31]->slug); 
    551         $this->assertEquals('sublunary', $cats[32]->name); 
    552         $this->assertEquals('sublunary', $cats[32]->slug); 
    553         $this->assertEquals('tamtam', $cats[33]->name); 
    554         $this->assertEquals('tamtam', $cats[33]->slug); 
    555         $this->assertEquals('weakhearted', $cats[34]->name); 
    556         $this->assertEquals('weakhearted', $cats[34]->slug); 
    557         $this->assertEquals('ween', $cats[35]->name); 
    558         $this->assertEquals('ween', $cats[35]->slug); 
    559         $this->assertEquals('wellhead', $cats[36]->name); 
    560         $this->assertEquals('wellhead', $cats[36]->slug); 
    561         $this->assertEquals('wellintentioned', $cats[37]->name); 
    562         $this->assertEquals('wellintentioned', $cats[37]->slug); 
    563         $this->assertEquals('whetstone', $cats[38]->name); 
    564         $this->assertEquals('whetstone', $cats[38]->slug); 
    565         $this->assertEquals('years', $cats[39]->name); 
    566         $this->assertEquals('years', $cats[39]->slug); 
    567         $tags = wp_get_post_tags($post->ID); 
    568         $this->assertEquals(0, count($tags)); 
    569         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    570         $this->assertEquals(0, count($comments)); 
    571  
    572  
    573         $post = $this->posts[9]; 
    574         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    575         $this->assertEquals("2007-11-24 06:09:34", $post->post_date); 
    576         $this->assertEquals("2007-11-23 20:09:34", $post->post_date_gmt); 
    577         $this->assertEquals("This post has far too many tags.", $post->post_content); 
    578         $this->assertEquals("Many tags", $post->post_title); 
    579         $this->assertEquals("0", $post->post_category); 
    580         $this->assertEquals("", $post->post_excerpt); 
    581         $this->assertEquals("publish", $post->post_status); 
    582         $this->assertEquals("open", $post->comment_status); 
    583         $this->assertEquals("open", $post->ping_status); 
    584         $this->assertEquals("", $post->post_password); 
    585         $this->assertEquals("many-tags", $post->post_name); 
    586         $this->assertEquals("", $post->to_ping); 
    587         $this->assertEquals("", $post->pinged); 
    588         $this->assertEquals("2007-11-24 06:09:34", $post->post_modified); 
    589         $this->assertEquals("2007-11-23 20:09:34", $post->post_modified_gmt); 
    590         $this->assertEquals("", $post->post_content_filtered); 
    591         $this->assertEquals("0", $post->post_parent); 
    592         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/24/many-tags/", $post->guid); 
    593         $this->assertEquals("0", $post->menu_order); 
    594         $this->assertEquals("post", $post->post_type); 
    595         $this->assertEquals("", $post->post_mime_type); 
    596         $this->assertEquals("0", $post->comment_count); 
    597         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    598         $this->assertEquals(1, count($cats)); 
    599         $this->assertEquals('Uncategorized', $cats[0]->name); 
    600         $this->assertEquals('uncategorized', $cats[0]->slug); 
    601         $tags = wp_get_post_tags($post->ID); 
    602         $this->assertEquals(36, count($tags)); 
    603         $this->assertEquals('chattels', $tags[0]->name); 
    604         $this->assertEquals('chattels', $tags[0]->slug); 
    605         $this->assertEquals('cienaga', $tags[1]->name); 
    606         $this->assertEquals('cienaga', $tags[1]->slug); 
    607         $this->assertEquals('claycold', $tags[2]->name); 
    608         $this->assertEquals('claycold', $tags[2]->slug); 
    609         $this->assertEquals('crushing', $tags[3]->name); 
    610         $this->assertEquals('crushing', $tags[3]->slug); 
    611         $this->assertEquals('dinarchy', $tags[4]->name); 
    612         $this->assertEquals('dinarchy', $tags[4]->slug); 
    613         $this->assertEquals('doolie', $tags[5]->name); 
    614         $this->assertEquals('doolie', $tags[5]->slug); 
    615         $this->assertEquals('energumen', $tags[6]->name); 
    616         $this->assertEquals('energumen', $tags[6]->slug); 
    617         $this->assertEquals('ephialtes', $tags[7]->name); 
    618         $this->assertEquals('ephialtes', $tags[7]->slug); 
    619         $this->assertEquals('eudiometer', $tags[8]->name); 
    620         $this->assertEquals('eudiometer', $tags[8]->slug); 
    621         $this->assertEquals('figuriste', $tags[9]->name); 
    622         $this->assertEquals('figuriste', $tags[9]->slug); 
    623         $this->assertEquals('habergeon', $tags[10]->name); 
    624         $this->assertEquals('habergeon', $tags[10]->slug); 
    625         $this->assertEquals('hapless', $tags[11]->name); 
    626         $this->assertEquals('hapless', $tags[11]->slug); 
    627         $this->assertEquals('hartshorn', $tags[12]->name); 
    628         $this->assertEquals('hartshorn', $tags[12]->slug); 
    629         $this->assertEquals('hostility impregnability', $tags[13]->name); 
    630         $this->assertEquals('hostility-impregnability', $tags[13]->slug); 
    631         $this->assertEquals('impropriation', $tags[14]->name); 
    632         $this->assertEquals('impropriation', $tags[14]->slug); 
    633         $this->assertEquals('knave', $tags[15]->name); 
    634         $this->assertEquals('knave', $tags[15]->slug); 
    635         $this->assertEquals('misinformed', $tags[16]->name); 
    636         $this->assertEquals('misinformed', $tags[16]->slug); 
    637         $this->assertEquals('moil', $tags[17]->name); 
    638         $this->assertEquals('moil', $tags[17]->slug); 
    639         $this->assertEquals('mornful', $tags[18]->name); 
    640         $this->assertEquals('mornful', $tags[18]->slug); 
    641         $this->assertEquals('outlaw', $tags[19]->name); 
    642         $this->assertEquals('outlaw', $tags[19]->slug); 
    643         $this->assertEquals('pamphjlet', $tags[20]->name); 
    644         $this->assertEquals('pamphjlet', $tags[20]->slug); 
    645         $this->assertEquals('pneumatics', $tags[21]->name); 
    646         $this->assertEquals('pneumatics', $tags[21]->slug); 
    647         $this->assertEquals('portly portreeve', $tags[22]->name); 
    648         $this->assertEquals('portly-portreeve', $tags[22]->slug); 
    649         $this->assertEquals('precipitancy', $tags[23]->name); 
    650         $this->assertEquals('precipitancy', $tags[23]->slug); 
    651         $this->assertEquals('privation', $tags[24]->name); 
    652         $this->assertEquals('privation', $tags[24]->slug); 
    653         $this->assertEquals('programme', $tags[25]->name); 
    654         $this->assertEquals('programme', $tags[25]->slug); 
    655         $this->assertEquals('psychological', $tags[26]->name); 
    656         $this->assertEquals('psychological', $tags[26]->slug); 
    657         $this->assertEquals('puncher', $tags[27]->name); 
    658         $this->assertEquals('puncher', $tags[27]->slug); 
    659         $this->assertEquals('ramose', $tags[28]->name); 
    660         $this->assertEquals('ramose', $tags[28]->slug); 
    661         $this->assertEquals('renegade', $tags[29]->name); 
    662         $this->assertEquals('renegade', $tags[29]->slug); 
    663         $this->assertEquals('retrocede', $tags[30]->name); 
    664         $this->assertEquals('retrocede', $tags[30]->slug); 
    665         $this->assertEquals('stagnation unhorsed', $tags[31]->name); 
    666         $this->assertEquals('stagnation-unhorsed', $tags[31]->slug); 
    667         $this->assertEquals('thunderheaded', $tags[32]->name); 
    668         $this->assertEquals('thunderheaded', $tags[32]->slug); 
    669         $this->assertEquals('unculpable', $tags[33]->name); 
    670         $this->assertEquals('unculpable', $tags[33]->slug); 
    671         $this->assertEquals('withered brandnew', $tags[34]->name); 
    672         $this->assertEquals('withered-brandnew', $tags[34]->slug); 
    673         $this->assertEquals('xanthopsia', $tags[35]->name); 
    674         $this->assertEquals('xanthopsia', $tags[35]->slug); 
    675         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    676         $this->assertEquals(0, count($comments)); 
    677  
    678  
    679         $post = $this->posts[10]; 
    680         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    681         $this->assertEquals("2007-11-09 11:39:38", $post->post_date); 
    682         $this->assertEquals("2007-11-09 01:39:38", $post->post_date_gmt); 
    683         $this->assertEquals("Post with Tag A and Tag C", $post->post_content); 
    684         $this->assertEquals("Tags A and C", $post->post_title); 
    685         $this->assertEquals("0", $post->post_category); 
    686         $this->assertEquals("", $post->post_excerpt); 
    687         $this->assertEquals("publish", $post->post_status); 
    688         $this->assertEquals("open", $post->comment_status); 
    689         $this->assertEquals("open", $post->ping_status); 
    690         $this->assertEquals("", $post->post_password); 
    691         $this->assertEquals("tags-a-and-c", $post->post_name); 
    692         $this->assertEquals("", $post->to_ping); 
    693         $this->assertEquals("", $post->pinged); 
    694         $this->assertEquals("2007-11-09 11:39:38", $post->post_modified); 
    695         $this->assertEquals("2007-11-09 01:39:38", $post->post_modified_gmt); 
    696         $this->assertEquals("", $post->post_content_filtered); 
    697         $this->assertEquals("0", $post->post_parent); 
    698         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tags-a-and-c/", $post->guid); 
    699         $this->assertEquals("0", $post->menu_order); 
    700         $this->assertEquals("post", $post->post_type); 
    701         $this->assertEquals("", $post->post_mime_type); 
    702         $this->assertEquals("0", $post->comment_count); 
    703         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    704         $this->assertEquals(1, count($cats)); 
    705         $this->assertEquals('Uncategorized', $cats[0]->name); 
    706         $this->assertEquals('uncategorized', $cats[0]->slug); 
    707         $tags = wp_get_post_tags($post->ID); 
    708         $this->assertEquals(2, count($tags)); 
    709         $this->assertEquals('Tag A', $tags[0]->name); 
    710         $this->assertEquals('tag-a', $tags[0]->slug); 
    711         $this->assertEquals('Tag C', $tags[1]->name); 
    712         $this->assertEquals('tag-c', $tags[1]->slug); 
    713         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    714         $this->assertEquals(0, count($comments)); 
    715  
    716  
    717         $post = $this->posts[11]; 
    718         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    719         $this->assertEquals("2007-11-09 11:39:16", $post->post_date); 
    720         $this->assertEquals("2007-11-09 01:39:16", $post->post_date_gmt); 
    721         $this->assertEquals("Post with Tag B and Tag C", $post->post_content); 
    722         $this->assertEquals("Tags B and C", $post->post_title); 
    723         $this->assertEquals("0", $post->post_category); 
    724         $this->assertEquals("", $post->post_excerpt); 
    725         $this->assertEquals("publish", $post->post_status); 
    726         $this->assertEquals("open", $post->comment_status); 
    727         $this->assertEquals("open", $post->ping_status); 
    728         $this->assertEquals("", $post->post_password); 
    729         $this->assertEquals("tags-b-and-c", $post->post_name); 
    730         $this->assertEquals("", $post->to_ping); 
    731         $this->assertEquals("", $post->pinged); 
    732         $this->assertEquals("2007-11-09 11:39:16", $post->post_modified); 
    733         $this->assertEquals("2007-11-09 01:39:16", $post->post_modified_gmt); 
    734         $this->assertEquals("", $post->post_content_filtered); 
    735         $this->assertEquals("0", $post->post_parent); 
    736         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tags-b-and-c/", $post->guid); 
    737         $this->assertEquals("0", $post->menu_order); 
    738         $this->assertEquals("post", $post->post_type); 
    739         $this->assertEquals("", $post->post_mime_type); 
    740         $this->assertEquals("0", $post->comment_count); 
    741         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    742         $this->assertEquals(1, count($cats)); 
    743         $this->assertEquals('Uncategorized', $cats[0]->name); 
    744         $this->assertEquals('uncategorized', $cats[0]->slug); 
    745         $tags = wp_get_post_tags($post->ID); 
    746         $this->assertEquals(2, count($tags)); 
    747         $this->assertEquals('Tag B', $tags[0]->name); 
    748         $this->assertEquals('tag-b', $tags[0]->slug); 
    749         $this->assertEquals('Tag C', $tags[1]->name); 
    750         $this->assertEquals('tag-c', $tags[1]->slug); 
    751         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    752         $this->assertEquals(0, count($comments)); 
    753  
    754  
    755         $post = $this->posts[12]; 
    756         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    757         $this->assertEquals("2007-11-09 11:38:56", $post->post_date); 
    758         $this->assertEquals("2007-11-09 01:38:56", $post->post_date_gmt); 
    759         $this->assertEquals("Post with Tag A and Tag B", $post->post_content); 
    760         $this->assertEquals("Tags A and B", $post->post_title); 
    761         $this->assertEquals("0", $post->post_category); 
    762         $this->assertEquals("", $post->post_excerpt); 
    763         $this->assertEquals("publish", $post->post_status); 
    764         $this->assertEquals("open", $post->comment_status); 
    765         $this->assertEquals("open", $post->ping_status); 
    766         $this->assertEquals("", $post->post_password); 
    767         $this->assertEquals("tags-a-and-b", $post->post_name); 
    768         $this->assertEquals("", $post->to_ping); 
    769         $this->assertEquals("", $post->pinged); 
    770         $this->assertEquals("2007-11-09 11:38:56", $post->post_modified); 
    771         $this->assertEquals("2007-11-09 01:38:56", $post->post_modified_gmt); 
    772         $this->assertEquals("", $post->post_content_filtered); 
    773         $this->assertEquals("0", $post->post_parent); 
    774         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tags-a-and-b/", $post->guid); 
    775         $this->assertEquals("0", $post->menu_order); 
    776         $this->assertEquals("post", $post->post_type); 
    777         $this->assertEquals("", $post->post_mime_type); 
    778         $this->assertEquals("0", $post->comment_count); 
    779         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    780         $this->assertEquals(1, count($cats)); 
    781         $this->assertEquals('Uncategorized', $cats[0]->name); 
    782         $this->assertEquals('uncategorized', $cats[0]->slug); 
    783         $tags = wp_get_post_tags($post->ID); 
    784         $this->assertEquals(2, count($tags)); 
    785         $this->assertEquals('Tag A', $tags[0]->name); 
    786         $this->assertEquals('tag-a', $tags[0]->slug); 
    787         $this->assertEquals('Tag B', $tags[1]->name); 
    788         $this->assertEquals('tag-b', $tags[1]->slug); 
    789         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    790         $this->assertEquals(0, count($comments)); 
    791  
    792  
    793         $post = $this->posts[13]; 
    794         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    795         $this->assertEquals("2007-11-09 11:38:16", $post->post_date); 
    796         $this->assertEquals("2007-11-09 01:38:16", $post->post_date_gmt); 
    797         $this->assertEquals("Post with Tag C", $post->post_content); 
    798         $this->assertEquals("Tag C", $post->post_title); 
    799         $this->assertEquals("0", $post->post_category); 
    800         $this->assertEquals("", $post->post_excerpt); 
    801         $this->assertEquals("publish", $post->post_status); 
    802         $this->assertEquals("open", $post->comment_status); 
    803         $this->assertEquals("open", $post->ping_status); 
    804         $this->assertEquals("", $post->post_password); 
    805         $this->assertEquals("tag-c", $post->post_name); 
    806         $this->assertEquals("", $post->to_ping); 
    807         $this->assertEquals("", $post->pinged); 
    808         $this->assertEquals("2007-11-09 11:38:16", $post->post_modified); 
    809         $this->assertEquals("2007-11-09 01:38:16", $post->post_modified_gmt); 
    810         $this->assertEquals("", $post->post_content_filtered); 
    811         $this->assertEquals("0", $post->post_parent); 
    812         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tag-c/", $post->guid); 
    813         $this->assertEquals("0", $post->menu_order); 
    814         $this->assertEquals("post", $post->post_type); 
    815         $this->assertEquals("", $post->post_mime_type); 
    816         $this->assertEquals("0", $post->comment_count); 
    817         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    818         $this->assertEquals(1, count($cats)); 
    819         $this->assertEquals('Uncategorized', $cats[0]->name); 
    820         $this->assertEquals('uncategorized', $cats[0]->slug); 
    821         $tags = wp_get_post_tags($post->ID); 
    822         $this->assertEquals(1, count($tags)); 
    823         $this->assertEquals('Tag C', $tags[0]->name); 
    824         $this->assertEquals('tag-c', $tags[0]->slug); 
    825         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    826         $this->assertEquals(0, count($comments)); 
    827  
    828  
    829         $post = $this->posts[14]; 
    830         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    831         $this->assertEquals("2007-11-09 11:37:57", $post->post_date); 
    832         $this->assertEquals("2007-11-09 01:37:57", $post->post_date_gmt); 
    833         $this->assertEquals("Post with Tag B", $post->post_content); 
    834         $this->assertEquals("Tag B", $post->post_title); 
    835         $this->assertEquals("0", $post->post_category); 
    836         $this->assertEquals("", $post->post_excerpt); 
    837         $this->assertEquals("publish", $post->post_status); 
    838         $this->assertEquals("open", $post->comment_status); 
    839         $this->assertEquals("open", $post->ping_status); 
    840         $this->assertEquals("", $post->post_password); 
    841         $this->assertEquals("tag-b", $post->post_name); 
    842         $this->assertEquals("", $post->to_ping); 
    843         $this->assertEquals("", $post->pinged); 
    844         $this->assertEquals("2007-11-09 11:37:57", $post->post_modified); 
    845         $this->assertEquals("2007-11-09 01:37:57", $post->post_modified_gmt); 
    846         $this->assertEquals("", $post->post_content_filtered); 
    847         $this->assertEquals("0", $post->post_parent); 
    848         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tag-b/", $post->guid); 
    849         $this->assertEquals("0", $post->menu_order); 
    850         $this->assertEquals("post", $post->post_type); 
    851         $this->assertEquals("", $post->post_mime_type); 
    852         $this->assertEquals("0", $post->comment_count); 
    853         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    854         $this->assertEquals(1, count($cats)); 
    855         $this->assertEquals('Uncategorized', $cats[0]->name); 
    856         $this->assertEquals('uncategorized', $cats[0]->slug); 
    857         $tags = wp_get_post_tags($post->ID); 
    858         $this->assertEquals(1, count($tags)); 
    859         $this->assertEquals('Tag B', $tags[0]->name); 
    860         $this->assertEquals('tag-b', $tags[0]->slug); 
    861         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    862         $this->assertEquals(0, count($comments)); 
    863  
    864  
    865         $post = $this->posts[15]; 
    866         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    867         $this->assertEquals("2007-11-09 11:37:39", $post->post_date); 
    868         $this->assertEquals("2007-11-09 01:37:39", $post->post_date_gmt); 
    869         $this->assertEquals("Post with Tag A", $post->post_content); 
    870         $this->assertEquals("Tag A", $post->post_title); 
    871         $this->assertEquals("0", $post->post_category); 
    872         $this->assertEquals("", $post->post_excerpt); 
    873         $this->assertEquals("publish", $post->post_status); 
    874         $this->assertEquals("open", $post->comment_status); 
    875         $this->assertEquals("open", $post->ping_status); 
    876         $this->assertEquals("", $post->post_password); 
    877         $this->assertEquals("tag-a", $post->post_name); 
    878         $this->assertEquals("", $post->to_ping); 
    879         $this->assertEquals("", $post->pinged); 
    880         $this->assertEquals("2007-11-09 11:37:39", $post->post_modified); 
    881         $this->assertEquals("2007-11-09 01:37:39", $post->post_modified_gmt); 
    882         $this->assertEquals("", $post->post_content_filtered); 
    883         $this->assertEquals("0", $post->post_parent); 
    884         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/11/09/tag-a/", $post->guid); 
    885         $this->assertEquals("0", $post->menu_order); 
    886         $this->assertEquals("post", $post->post_type); 
    887         $this->assertEquals("", $post->post_mime_type); 
    888         $this->assertEquals("0", $post->comment_count); 
    889         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    890         $this->assertEquals(1, count($cats)); 
    891         $this->assertEquals('Uncategorized', $cats[0]->name); 
    892         $this->assertEquals('uncategorized', $cats[0]->slug); 
    893         $tags = wp_get_post_tags($post->ID); 
    894         $this->assertEquals(1, count($tags)); 
    895         $this->assertEquals('Tag A', $tags[0]->name); 
    896         $this->assertEquals('tag-a', $tags[0]->slug); 
    897         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    898         $this->assertEquals(0, count($comments)); 
    899  
    900  
    901         $post = $this->posts[16]; 
    902         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    903         $this->assertEquals("2007-09-15 16:51:47", $post->post_date); 
    904         $this->assertEquals("2007-09-15 06:51:47", $post->post_date_gmt); 
    905         $this->assertEquals("Simple tag test.", $post->post_content); 
    906         $this->assertEquals("Tags A, B, C", $post->post_title); 
    907         $this->assertEquals("0", $post->post_category); 
    908         $this->assertEquals("", $post->post_excerpt); 
    909         $this->assertEquals("publish", $post->post_status); 
    910         $this->assertEquals("open", $post->comment_status); 
    911         $this->assertEquals("open", $post->ping_status); 
    912         $this->assertEquals("", $post->post_password); 
    913         $this->assertEquals("tags-a-b-c", $post->post_name); 
    914         $this->assertEquals("", $post->to_ping); 
    915         $this->assertEquals("", $post->pinged); 
    916         $this->assertEquals("2007-09-15 16:51:47", $post->post_modified); 
    917         $this->assertEquals("2007-09-15 06:51:47", $post->post_modified_gmt); 
    918         $this->assertEquals("", $post->post_content_filtered); 
    919         $this->assertEquals("0", $post->post_parent); 
    920         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/15/tags-a-b-c/", $post->guid); 
    921         $this->assertEquals("0", $post->menu_order); 
    922         $this->assertEquals("post", $post->post_type); 
    923         $this->assertEquals("", $post->post_mime_type); 
    924         $this->assertEquals("0", $post->comment_count); 
    925         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    926         $this->assertEquals(1, count($cats)); 
    927         $this->assertEquals('Uncategorized', $cats[0]->name); 
    928         $this->assertEquals('uncategorized', $cats[0]->slug); 
    929         $tags = wp_get_post_tags($post->ID); 
    930         $this->assertEquals(3, count($tags)); 
    931         $this->assertEquals('Tag A', $tags[0]->name); 
    932         $this->assertEquals('tag-a', $tags[0]->slug); 
    933         $this->assertEquals('Tag B', $tags[1]->name); 
    934         $this->assertEquals('tag-b', $tags[1]->slug); 
    935         $this->assertEquals('Tag C', $tags[2]->name); 
    936         $this->assertEquals('tag-c', $tags[2]->slug); 
    937         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    938         $this->assertEquals(0, count($comments)); 
    939  
    940  
    941         $post = $this->posts[17]; 
    942         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    943         $this->assertEquals("2007-09-05 14:41:08", $post->post_date); 
    944         $this->assertEquals("2007-09-05 04:41:08", $post->post_date_gmt); 
    945         $this->assertEquals("All the HTML tags listed in the <a href=\"http://faq.wordpress.com/2006/06/08/allowed-html-tags/\">FAQ</a>:\n\n<address>an address</address>\n<a href=\"http://example.com\">a link</a>\n<abbr title=\"abbreviation\">abbr.</abbr>\n<acronym title=\"acronym\">acr.</acronym>\n<b>bold<b>\n<big>big</big>\n<blockquote>a blockquote</blockquote>\nline<br />break\n<cite>a citation</cite>\n\"class\" - eh?\n<code>some code</code>\n<del>deleted text</del>\n<div class=\"myclass\">a div</div>\n<em>emphasis</em>\n<font>font tags are bad</font>\n<h1>heading 1</h1>\n<h2>heading 2</h2>\n<h3>heading 3</h3>\n<h4>heading 4</h4>\n<h5>heading 5</h5>\n<h6>heading 6</h6>\n<i>italic</i>\n<img src=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg\" />\n<ins>inserted text</ins>\n<kbd>keyboard text</kbd>\n<p>a paragraph</p>\n<pre>pre-\nformatted\ntext</pre>\n<q>a quote</q>\n<s>strike</s>\n<strong>strong</strong>\n<sub>subtext</sub>\n<sup>supertext</sup>\n<tt>teletype text</tt>\n<var>variable</var>\n\n\nList tags:\n\n<dl>\n<dt>term</dt>\n<dd>definition</dd>\n<dt>term 2</dt>\n<dd>definition 2</dd>\n</dl>\n\n<ul>\n<li>item 1</li>\n<li>item 2</li>\n</ul>\n\n<ol>\n<li>item 1</li>\n<li>item 2</li>\n</ol>\n\n\nTable tags:\n\n<table border=\"1\">\n<caption>table caption</caption>\n<col />\n<col />\n<thead>\n<tr>\n<th>heading 1</th>\n<th>heading 2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Cell 1</td>\n<td>Cell 2</td>\n</tr>\n</tbody>\n<tfoot>\n<tr>\n<td>footer 1</td>\n<td>footer 2</td>\n</tr>\n</tfoot>\n</table>", $post->post_content); 
    946         $this->assertEquals("Raw HTML code", $post->post_title); 
    947         $this->assertEquals("0", $post->post_category); 
    948         $this->assertEquals("", $post->post_excerpt); 
    949         $this->assertEquals("publish", $post->post_status); 
    950         $this->assertEquals("open", $post->comment_status); 
    951         $this->assertEquals("open", $post->ping_status); 
    952         $this->assertEquals("", $post->post_password); 
    953         $this->assertEquals("raw-html-code", $post->post_name); 
    954         $this->assertEquals("", $post->to_ping); 
    955         $this->assertEquals("", $post->pinged); 
    956         $this->assertEquals("2007-09-05 14:41:08", $post->post_modified); 
    957         $this->assertEquals("2007-09-05 04:41:08", $post->post_modified_gmt); 
    958         $this->assertEquals("", $post->post_content_filtered); 
    959         $this->assertEquals("0", $post->post_parent); 
    960         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/05/raw-html-code/", $post->guid); 
    961         $this->assertEquals("0", $post->menu_order); 
    962         $this->assertEquals("post", $post->post_type); 
    963         $this->assertEquals("", $post->post_mime_type); 
    964         $this->assertEquals("0", $post->comment_count); 
    965         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    966         $this->assertEquals(1, count($cats)); 
    967         $this->assertEquals('Uncategorized', $cats[0]->name); 
    968         $this->assertEquals('uncategorized', $cats[0]->slug); 
    969         $tags = wp_get_post_tags($post->ID); 
    970         $this->assertEquals(0, count($tags)); 
    971         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    972         $this->assertEquals(0, count($comments)); 
    973  
    974  
    975         $post = $this->posts[18]; 
    976         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    977         $this->assertEquals("2007-09-04 12:11:23", $post->post_date); 
    978         $this->assertEquals("2007-09-04 02:11:23", $post->post_date_gmt); 
    979         $this->assertEquals("Simple markup inserted using the visual editor:\n\n<strong>Bold</strong>, <em>italic</em>, <strike>strike</strike>.\n<ul>\n\t<li>Bullet 1</li>\n\t<li>Bullet 2\n<ul>\n\t<li>Bullet 3\n<ul>\n\t<li>Bullet 4</li>\n</ul>\n</li>\n</ul>\n</li>\n\t<li>Bullet 5</li>\n</ul>\n<ol>\n\t<li>List 1</li>\n\t<li>List 2\n<ol>\n\t<li>List 3\n<ol>\n\t<li>List 4</li>\n</ol>\n</li>\n\t<li>List 5</li>\n</ol>\n</li>\n\t<li>List 6</li>\n</ol>\nLeft align:\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl. Quisque quis urna in velit dictum pellentesque. Vivamus a quam. Curabitur eu tortor id turpis tristique adipiscing. Morbi blandit. Maecenas vel est. Nunc aliquam, orci at accumsan commodo, libero nibh euismod augue, a ullamcorper velit dui et purus. Aenean volutpat, ipsum ac imperdiet fermentum, dui dui suscipit arcu, vitae dictum purus diam ac ligula. Praesent enim nunc, pretium eget, tincidunt in, semper at, mauris. Etiam nec ligula. Aenean purus pede, sagittis at, blandit a, dignissim nec, elit. Etiam nunc. Praesent molestie consectetuer leo. Etiam blandit leo mollis velit. Aenean varius. Maecenas in magna nec justo ornare feugiat. Mauris elit. Nunc volutpat lectus fermentum nibh.\n\nCenter:\n<p align=\"center\">Aenean a turpis eu augue luctus vulputate. Ut nonummy arcu in est. Nulla facilisi. Fusce at est sollicitudin pede gravida luctus. Sed ut dolor non nulla luctus aliquam. Phasellus sodales dapibus turpis. Nulla malesuada. In sed quam. Donec sollicitudin convallis nisl. Donec nunc. Suspendisse malesuada libero in nisi. Etiam vitae metus non arcu gravida tincidunt. Duis accumsan purus et orci. Curabitur volutpat. Nulla quis purus id enim dapibus malesuada. Nam egestas luctus arcu. Praesent iaculis massa.</p>\n<p align=\"left\">Right:</p>\n<p align=\"right\">Aenean tempor, risus nec eleifend tristique, sem orci aliquam urna, eget iaculis tortor mauris ut lorem. Aenean eu tellus. Sed at mauris at nisl ultricies lobortis. Vivamus lacinia, lorem vel congue facilisis, leo leo sodales leo, vitae euismod velit ante a ligula. Vivamus sit amet turpis ut eros molestie porttitor. Nam erat lacus, auctor vel, dictum a, suscipit sed, orci. Quisque est lorem, facilisis consequat, sagittis a, ullamcorper at, ante. Nullam ultricies gravida dui. Nunc mauris. Quisque neque. Quisque eu sem.</p>\n<p align=\"left\">Blockquote:</p>\n\n<blockquote>\n<p align=\"left\">Said Hamlet to Ophelia,\nI'll draw a sketch of thee,\nWhat kind of pencil shall I use?\n2B or not 2B?</blockquote>\n<p align=\"left\"><a href=\"http://example.com/\">Link 1</a>, <a href=\"http://example.com/\" target=\"_blank\">Link 2 (new window)</a>, <a href=\"http://example.com/\">Link 3 (title)</a>.</p>\n<p align=\"left\"> <img src=\"http://wordpress.org/about/images/black-120x90.png\" alt=\"wordpress logo\" height=\"90\" width=\"120\" /> <img src=\"http://wordpress.org/about/images/black-120x90.png\" align=\"right\" height=\"90\" width=\"120\" /></p>\n<p align=\"left\"> Paragraph</p>\n\n<address>Address 1</address> <address>Address 2</address>\n<pre> Pre 1</pre>\n<pre>Pre 2</pre>\n<pre>Pre 3</pre>\n<h1>Heading 1</h1>\n<h2>Heading 2</h2>\n<h3>Heading 3</h3>\n<h4>Heading 4</h4>\n<h5>Heading 5</h5>\n<h6>Heading 6</h6>\n<u>Underline</u>\n\nJustified:\n<p align=\"justify\"> Vivamus volutpat, arcu sed venenatis consequat, nulla pede blandit neque, quis ultrices ligula mauris ut leo. Proin iaculis. Pellentesque vulputate magna at lectus. Etiam semper aliquet lectus. Nullam turpis. Vivamus sed lacus. Integer metus arcu, adipiscing sed, vehicula et, vulputate sit amet, massa. Sed lobortis tempus lectus. In lacus. Duis nibh. Donec molestie libero ut neque. In sollicitudin aliquam felis. Sed molestie libero ac mi. Curabitur magna nunc, feugiat sed, sodales vitae, pretium a, leo. Sed ut ante. Integer turpis ante, facilisis sed, dignissim vitae, consectetuer sed, dui. Sed ultricies.</p>\n<p align=\"left\"><font color=\"#ff0000\">Red </font> <font color=\"#0000ff\">blue <font color=\"#00ff00\">green <font color=\"#000000\">black <font color=\"#ffffff\">white</font></font></font></font></p>\n<p align=\"left\">€  ≥ ° ψ</p>\n<p align=\"left\">&nbsp;</p>", $post->post_content); 
    980         $this->assertEquals("Simple markup test", $post->post_title); 
    981         $this->assertEquals("0", $post->post_category); 
    982         $this->assertEquals("", $post->post_excerpt); 
    983         $this->assertEquals("publish", $post->post_status); 
    984         $this->assertEquals("open", $post->comment_status); 
    985         $this->assertEquals("open", $post->ping_status); 
    986         $this->assertEquals("", $post->post_password); 
    987         $this->assertEquals("simple-markup-test", $post->post_name); 
    988         $this->assertEquals("", $post->to_ping); 
    989         $this->assertEquals("", $post->pinged); 
    990         $this->assertEquals("2007-09-04 12:11:23", $post->post_modified); 
    991         $this->assertEquals("2007-09-04 02:11:23", $post->post_modified_gmt); 
    992         $this->assertEquals("", $post->post_content_filtered); 
    993         $this->assertEquals("0", $post->post_parent); 
    994         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/simple-markup-test/", $post->guid); 
    995         $this->assertEquals("0", $post->menu_order); 
    996         $this->assertEquals("post", $post->post_type); 
    997         $this->assertEquals("", $post->post_mime_type); 
    998         $this->assertEquals("0", $post->comment_count); 
    999         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1000         $this->assertEquals(1, count($cats)); 
    1001         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1002         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1003         $tags = wp_get_post_tags($post->ID); 
    1004         $this->assertEquals(0, count($tags)); 
    1005         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1006         $this->assertEquals(0, count($comments)); 
    1007  
    1008  
    1009         $post = $this->posts[19]; 
    1010         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1011         $this->assertEquals("2007-09-04 11:53:10", $post->post_date); 
    1012         $this->assertEquals("2007-09-04 01:53:10", $post->post_date_gmt); 
    1013         $this->assertEquals("Posted as per the instructions in the FAQ.\n\n[youtube=http://www.youtube.com/watch?v=FCXlCkY4Y5g]\n\n[googlevideo=http://video.google.com/videoplay?docid=-184752788325410734]", $post->post_content); 
    1014         $this->assertEquals("Embedded video", $post->post_title); 
    1015         $this->assertEquals("0", $post->post_category); 
    1016         $this->assertEquals("", $post->post_excerpt); 
    1017         $this->assertEquals("publish", $post->post_status); 
    1018         $this->assertEquals("open", $post->comment_status); 
    1019         $this->assertEquals("open", $post->ping_status); 
    1020         $this->assertEquals("", $post->post_password); 
    1021         $this->assertEquals("embedded-video", $post->post_name); 
    1022         $this->assertEquals("", $post->to_ping); 
    1023         $this->assertEquals("", $post->pinged); 
    1024         $this->assertEquals("2007-09-04 11:53:10", $post->post_modified); 
    1025         $this->assertEquals("2007-09-04 01:53:10", $post->post_modified_gmt); 
    1026         $this->assertEquals("", $post->post_content_filtered); 
    1027         $this->assertEquals("0", $post->post_parent); 
    1028         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/embedded-video/", $post->guid); 
    1029         $this->assertEquals("0", $post->menu_order); 
    1030         $this->assertEquals("post", $post->post_type); 
    1031         $this->assertEquals("", $post->post_mime_type); 
    1032         $this->assertEquals("0", $post->comment_count); 
    1033         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1034         $this->assertEquals(1, count($cats)); 
    1035         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1036         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1037         $tags = wp_get_post_tags($post->ID); 
    1038         $this->assertEquals(0, count($tags)); 
    1039         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1040         $this->assertEquals(0, count($comments)); 
    1041  
    1042  
    1043         $post = $this->posts[20]; 
    1044         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1045         $this->assertEquals("2007-09-04 10:48:10", $post->post_date); 
    1046         $this->assertEquals("2007-09-04 00:48:10", $post->post_date_gmt); 
    1047         $this->assertEquals("No comments here.", $post->post_content); 
    1048         $this->assertEquals("Page with comments disabled", $post->post_title); 
    1049         $this->assertEquals("0", $post->post_category); 
    1050         $this->assertEquals("", $post->post_excerpt); 
    1051         $this->assertEquals("publish", $post->post_status); 
    1052         $this->assertEquals("closed", $post->comment_status); 
    1053         $this->assertEquals("closed", $post->ping_status); 
    1054         $this->assertEquals("", $post->post_password); 
    1055         $this->assertEquals("page-with-comments-disabled", $post->post_name); 
    1056         $this->assertEquals("", $post->to_ping); 
    1057         $this->assertEquals("", $post->pinged); 
    1058         $this->assertEquals("2007-09-04 10:48:10", $post->post_modified); 
    1059         $this->assertEquals("2007-09-04 00:48:10", $post->post_modified_gmt); 
    1060         $this->assertEquals("", $post->post_content_filtered); 
    1061         $this->assertEquals("0", $post->post_parent); 
    1062         $this->assertEquals("http://asdftestblog1.wordpress.com/page-with-comments-disabled/", $post->guid); 
    1063         $this->assertEquals("0", $post->menu_order); 
    1064         $this->assertEquals("page", $post->post_type); 
    1065         $this->assertEquals("", $post->post_mime_type); 
    1066         $this->assertEquals("0", $post->comment_count); 
    1067         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1068         $this->assertEquals(1, count($cats)); 
    1069         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1070         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1071         $tags = wp_get_post_tags($post->ID); 
    1072         $this->assertEquals(0, count($tags)); 
    1073         $this->assertEquals(array ( 
    1074   0 => 'default', 
    1075 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1076         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1077         $this->assertEquals(0, count($comments)); 
    1078  
    1079  
    1080         $post = $this->posts[21]; 
    1081         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1082         $this->assertEquals("2007-09-04 10:47:47", $post->post_date); 
    1083         $this->assertEquals("2007-09-04 00:47:47", $post->post_date_gmt); 
    1084         $this->assertEquals("This page has comments.", $post->post_content); 
    1085         $this->assertEquals("Page with comments", $post->post_title); 
    1086         $this->assertEquals("0", $post->post_category); 
    1087         $this->assertEquals("", $post->post_excerpt); 
    1088         $this->assertEquals("publish", $post->post_status); 
    1089         $this->assertEquals("open", $post->comment_status); 
    1090         $this->assertEquals("open", $post->ping_status); 
    1091         $this->assertEquals("", $post->post_password); 
    1092         $this->assertEquals("page-with-comments", $post->post_name); 
    1093         $this->assertEquals("", $post->to_ping); 
    1094         $this->assertEquals("", $post->pinged); 
    1095         $this->assertEquals("2007-09-04 10:47:47", $post->post_modified); 
    1096         $this->assertEquals("2007-09-04 00:47:47", $post->post_modified_gmt); 
    1097         $this->assertEquals("", $post->post_content_filtered); 
    1098         $this->assertEquals("0", $post->post_parent); 
    1099         $this->assertEquals("http://asdftestblog1.wordpress.com/page-with-comments/", $post->guid); 
    1100         $this->assertEquals("0", $post->menu_order); 
    1101         $this->assertEquals("page", $post->post_type); 
    1102         $this->assertEquals("", $post->post_mime_type); 
    1103         $this->assertEquals("3", $post->comment_count); 
    1104         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1105         $this->assertEquals(1, count($cats)); 
    1106         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1107         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1108         $tags = wp_get_post_tags($post->ID); 
    1109         $this->assertEquals(0, count($tags)); 
    1110         $this->assertEquals(array ( 
    1111   0 => 'default', 
    1112 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1113         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1114         $this->assertEquals(3, count($comments)); 
    1115         $this->assertEquals('Anon', $comments[0]->comment_author); 
    1116         $this->assertEquals('anon@example.com', $comments[0]->comment_author_email); 
    1117         $this->assertEquals('', $comments[0]->comment_author_url); 
    1118         $this->assertEquals('59.167.157.3', $comments[0]->comment_author_IP); 
    1119         $this->assertEquals('2007-09-04 10:49:28', $comments[0]->comment_date); 
    1120         $this->assertEquals('2007-09-04 00:49:28', $comments[0]->comment_date_gmt); 
    1121         $this->assertEquals('0', $comments[0]->comment_karma); 
    1122         $this->assertEquals('1', $comments[0]->comment_approved); 
    1123         $this->assertEquals('', $comments[0]->comment_agent); 
    1124         $this->assertEquals('', $comments[0]->comment_type); 
    1125         $this->assertEquals('0', $comments[0]->comment_parent); 
    1126         $this->assertEquals('', $comments[0]->comment_user_id); 
    1127         $this->assertEquals('tellyworthtest2', $comments[1]->comment_author); 
    1128         $this->assertEquals('tellyworth+test2@gmail.com', $comments[1]->comment_author_email); 
    1129         $this->assertEquals('', $comments[1]->comment_author_url); 
    1130         $this->assertEquals('59.167.157.3', $comments[1]->comment_author_IP); 
    1131         $this->assertEquals('2007-09-04 10:49:03', $comments[1]->comment_date); 
    1132         $this->assertEquals('2007-09-04 00:49:03', $comments[1]->comment_date_gmt); 
    1133         $this->assertEquals('0', $comments[1]->comment_karma); 
    1134         $this->assertEquals('1', $comments[1]->comment_approved); 
    1135         $this->assertEquals('', $comments[1]->comment_agent); 
    1136         $this->assertEquals('', $comments[1]->comment_type); 
    1137         $this->assertEquals('0', $comments[1]->comment_parent); 
    1138         $this->assertEquals('', $comments[1]->comment_user_id); 
    1139         $this->assertEquals('Alex Shiels', $comments[2]->comment_author); 
    1140         $this->assertEquals('tellyworth@gmail.com', $comments[2]->comment_author_email); 
    1141         $this->assertEquals('http://flightpath.wordpress.com/', $comments[2]->comment_author_url); 
    1142         $this->assertEquals('59.167.157.3', $comments[2]->comment_author_IP); 
    1143         $this->assertEquals('2007-09-04 10:48:51', $comments[2]->comment_date); 
    1144         $this->assertEquals('2007-09-04 00:48:51', $comments[2]->comment_date_gmt); 
    1145         $this->assertEquals('0', $comments[2]->comment_karma); 
    1146         $this->assertEquals('1', $comments[2]->comment_approved); 
    1147         $this->assertEquals('', $comments[2]->comment_agent); 
    1148         $this->assertEquals('', $comments[2]->comment_type); 
    1149         $this->assertEquals('0', $comments[2]->comment_parent); 
    1150         $this->assertEquals('', $comments[2]->comment_user_id); 
    1151  
    1152  
    1153         $post = $this->posts[22]; 
    1154         $this->assertEquals(get_profile('ID', 'User B'), $post->post_author); 
    1155         $this->assertEquals("2007-09-04 10:39:56", $post->post_date); 
    1156         $this->assertEquals("2007-09-04 00:39:56", $post->post_date_gmt); 
    1157         $this->assertEquals("I'm just a lowly contributor.  My posts must be approved by the editor.", $post->post_content); 
    1158         $this->assertEquals("Contributor post, approved", $post->post_title); 
    1159         $this->assertEquals("0", $post->post_category); 
    1160         $this->assertEquals("", $post->post_excerpt); 
    1161         $this->assertEquals("publish", $post->post_status); 
    1162         $this->assertEquals("open", $post->comment_status); 
    1163         $this->assertEquals("open", $post->ping_status); 
    1164         $this->assertEquals("", $post->post_password); 
    1165         $this->assertEquals("contributor-post-approved", $post->post_name); 
    1166         $this->assertEquals("", $post->to_ping); 
    1167         $this->assertEquals("", $post->pinged); 
    1168         $this->assertEquals("2007-09-04 10:39:56", $post->post_modified); 
    1169         $this->assertEquals("2007-09-04 00:39:56", $post->post_modified_gmt); 
    1170         $this->assertEquals("", $post->post_content_filtered); 
    1171         $this->assertEquals("0", $post->post_parent); 
    1172         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/contributor-post-approved/", $post->guid); 
    1173         $this->assertEquals("0", $post->menu_order); 
    1174         $this->assertEquals("post", $post->post_type); 
    1175         $this->assertEquals("", $post->post_mime_type); 
    1176         $this->assertEquals("0", $post->comment_count); 
    1177         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1178         $this->assertEquals(1, count($cats)); 
    1179         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1180         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1181         $tags = wp_get_post_tags($post->ID); 
    1182         $this->assertEquals(0, count($tags)); 
    1183         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1184         $this->assertEquals(0, count($comments)); 
    1185  
    1186  
    1187         $post = $this->posts[23]; 
    1188         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1189         $this->assertEquals("2007-09-04 10:25:29", $post->post_date); 
    1190         $this->assertEquals("2007-09-04 00:25:29", $post->post_date_gmt); 
    1191         $this->assertEquals("A post with a single comment.", $post->post_content); 
    1192         $this->assertEquals("One comment", $post->post_title); 
    1193         $this->assertEquals("0", $post->post_category); 
    1194         $this->assertEquals("", $post->post_excerpt); 
    1195         $this->assertEquals("publish", $post->post_status); 
    1196         $this->assertEquals("open", $post->comment_status); 
    1197         $this->assertEquals("open", $post->ping_status); 
    1198         $this->assertEquals("", $post->post_password); 
    1199         $this->assertEquals("one-comment", $post->post_name); 
    1200         $this->assertEquals("", $post->to_ping); 
    1201         $this->assertEquals("", $post->pinged); 
    1202         $this->assertEquals("2007-09-04 10:25:29", $post->post_modified); 
    1203         $this->assertEquals("2007-09-04 00:25:29", $post->post_modified_gmt); 
    1204         $this->assertEquals("", $post->post_content_filtered); 
    1205         $this->assertEquals("0", $post->post_parent); 
    1206         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/one-comment/", $post->guid); 
    1207         $this->assertEquals("0", $post->menu_order); 
    1208         $this->assertEquals("post", $post->post_type); 
    1209         $this->assertEquals("", $post->post_mime_type); 
    1210         $this->assertEquals("1", $post->comment_count); 
    1211         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1212         $this->assertEquals(1, count($cats)); 
    1213         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1214         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1215         $tags = wp_get_post_tags($post->ID); 
    1216         $this->assertEquals(0, count($tags)); 
    1217         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1218         $this->assertEquals(1, count($comments)); 
    1219         $this->assertEquals('Alex Shiels', $comments[0]->comment_author); 
    1220         $this->assertEquals('tellyworth@gmail.com', $comments[0]->comment_author_email); 
    1221         $this->assertEquals('http://flightpath.wordpress.com/', $comments[0]->comment_author_url); 
    1222         $this->assertEquals('59.167.157.3', $comments[0]->comment_author_IP); 
    1223         $this->assertEquals('2007-09-06 15:12:08', $comments[0]->comment_date); 
    1224         $this->assertEquals('2007-09-06 05:12:08', $comments[0]->comment_date_gmt); 
    1225         $this->assertEquals('0', $comments[0]->comment_karma); 
    1226         $this->assertEquals('1', $comments[0]->comment_approved); 
    1227         $this->assertEquals('', $comments[0]->comment_agent); 
    1228         $this->assertEquals('', $comments[0]->comment_type); 
    1229         $this->assertEquals('0', $comments[0]->comment_parent); 
    1230         $this->assertEquals('', $comments[0]->comment_user_id); 
    1231  
    1232  
    1233         $post = $this->posts[24]; 
    1234         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1235         $this->assertEquals("2007-09-04 10:21:15", $post->post_date); 
    1236         $this->assertEquals("2007-09-04 00:21:15", $post->post_date_gmt); 
    1237         $this->assertEquals("Comments are disabled.", $post->post_content); 
    1238         $this->assertEquals("No comments", $post->post_title); 
    1239         $this->assertEquals("0", $post->post_category); 
    1240         $this->assertEquals("", $post->post_excerpt); 
    1241         $this->assertEquals("publish", $post->post_status); 
    1242         $this->assertEquals("closed", $post->comment_status); 
    1243         $this->assertEquals("closed", $post->ping_status); 
    1244         $this->assertEquals("", $post->post_password); 
    1245         $this->assertEquals("no-comments", $post->post_name); 
    1246         $this->assertEquals("", $post->to_ping); 
    1247         $this->assertEquals("", $post->pinged); 
    1248         $this->assertEquals("2007-09-04 10:21:15", $post->post_modified); 
    1249         $this->assertEquals("2007-09-04 00:21:15", $post->post_modified_gmt); 
    1250         $this->assertEquals("", $post->post_content_filtered); 
    1251         $this->assertEquals("0", $post->post_parent); 
    1252         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/no-comments/", $post->guid); 
    1253         $this->assertEquals("0", $post->menu_order); 
    1254         $this->assertEquals("post", $post->post_type); 
    1255         $this->assertEquals("", $post->post_mime_type); 
    1256         $this->assertEquals("0", $post->comment_count); 
    1257         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1258         $this->assertEquals(1, count($cats)); 
    1259         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1260         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1261         $tags = wp_get_post_tags($post->ID); 
    1262         $this->assertEquals(0, count($tags)); 
    1263         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1264         $this->assertEquals(0, count($comments)); 
    1265  
    1266  
    1267         $post = $this->posts[25]; 
    1268         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1269         $this->assertEquals("2007-09-04 10:17:18", $post->post_date); 
    1270         $this->assertEquals("2007-09-04 00:17:18", $post->post_date_gmt); 
    1271         #$this->assertEquals("This post has many trackbacks.<span style=\"font-family:Arial;font-size:11px;line-height:normal;\" class=\"Apple-style-span\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras ligula. Vivamus urna diam, mollis nec, pellentesque et, semper nec, lorem. Nam lobortis, eros a feugiat porttitor, nibh mi imperdiet nulla, eu venenatis diam enim non eros. Duis consectetuer augue a ante. Vivamus adipiscing orci et ipsum. Ut consectetuer lacinia magna. Etiam id orci. Vestibulum pede magna, feugiat et, adipiscing vitae, tincidunt non, mauris. Curabitur auctor diam non nibh. Fusce nec diam. Praesent laoreet blandit turpis. Phasellus et eros. Nulla venenatis nulla ut magna. Nunc porttitor eros sed quam. Morbi id nisi ut sem faucibus tempus.</span> ", $post->post_content); 
    1272         $this->assertEquals("Many Trackbacks", $post->post_title); 
    1273         $this->assertEquals("0", $post->post_category); 
    1274         $this->assertEquals("", $post->post_excerpt); 
    1275         $this->assertEquals("publish", $post->post_status); 
    1276         $this->assertEquals("open", $post->comment_status); 
    1277         $this->assertEquals("open", $post->ping_status); 
    1278         $this->assertEquals("", $post->post_password); 
    1279         $this->assertEquals("many-trackbacks", $post->post_name); 
    1280         $this->assertEquals("", $post->to_ping); 
    1281         $this->assertEquals("", $post->pinged); 
    1282         $this->assertEquals("2007-09-04 10:17:18", $post->post_modified); 
    1283         $this->assertEquals("2007-09-04 00:17:18", $post->post_modified_gmt); 
    1284         $this->assertEquals("", $post->post_content_filtered); 
    1285         $this->assertEquals("0", $post->post_parent); 
    1286         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/many-trackbacks/", $post->guid); 
    1287         $this->assertEquals("0", $post->menu_order); 
    1288         $this->assertEquals("post", $post->post_type); 
    1289         $this->assertEquals("", $post->post_mime_type); 
    1290         $this->assertEquals("4", $post->comment_count); 
    1291         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1292         $this->assertEquals(1, count($cats)); 
    1293         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1294         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1295         $tags = wp_get_post_tags($post->ID); 
    1296         $this->assertEquals(0, count($tags)); 
    1297         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1298         $this->assertEquals(4, count($comments)); 
    1299         $this->assertEquals('Ping 4 &laquo; What&#8217;s a tellyworth?', $comments[0]->comment_author); 
    1300         $this->assertEquals('', $comments[0]->comment_author_email); 
    1301         $this->assertEquals('http://tellyworth.wordpress.com/2007/11/21/ping-4/', $comments[0]->comment_author_url); 
    1302         $this->assertEquals('72.232.101.12', $comments[0]->comment_author_IP); 
    1303         $this->assertEquals('2007-11-21 11:39:25', $comments[0]->comment_date); 
    1304         $this->assertEquals('2007-11-21 01:39:25', $comments[0]->comment_date_gmt); 
    1305         $this->assertEquals('0', $comments[0]->comment_karma); 
    1306         $this->assertEquals('1', $comments[0]->comment_approved); 
    1307         $this->assertEquals('', $comments[0]->comment_agent); 
    1308         $this->assertEquals('pingback', $comments[0]->comment_type); 
    1309         $this->assertEquals('0', $comments[0]->comment_parent); 
    1310         $this->assertEquals('', $comments[0]->comment_user_id); 
    1311         $this->assertEquals('Ping 3 &laquo; What&#8217;s a tellyworth?', $comments[1]->comment_author); 
    1312         $this->assertEquals('', $comments[1]->comment_author_email); 
    1313         $this->assertEquals('http://tellyworth.wordpress.com/2007/11/21/ping-3/', $comments[1]->comment_author_url); 
    1314         $this->assertEquals('72.232.101.12', $comments[1]->comment_author_IP); 
    1315         $this->assertEquals('2007-11-21 11:38:22', $comments[1]->comment_date); 
    1316         $this->assertEquals('2007-11-21 01:38:22', $comments[1]->comment_date_gmt); 
    1317         $this->assertEquals('0', $comments[1]->comment_karma); 
    1318         $this->assertEquals('1', $comments[1]->comment_approved); 
    1319         $this->assertEquals('', $comments[1]->comment_agent); 
    1320         $this->assertEquals('pingback', $comments[1]->comment_type); 
    1321         $this->assertEquals('0', $comments[1]->comment_parent); 
    1322         $this->assertEquals('', $comments[1]->comment_user_id); 
    1323         $this->assertEquals('Ping 2 with a much longer title than the previous ping, which was called Ping 1 &laquo; What&#8217;s a tellyworth?', $comments[2]->comment_author); 
    1324         $this->assertEquals('', $comments[2]->comment_author_email); 
    1325         $this->assertEquals('http://tellyworth.wordpress.com/2007/11/21/ping-2-with-a-much-longer-title-than-the-previous-ping-which-was-called-ping-1/', $comments[2]->comment_author_url); 
    1326         $this->assertEquals('72.232.101.12', $comments[2]->comment_author_IP); 
    1327         $this->assertEquals('2007-11-21 11:35:47', $comments[2]->comment_date); 
    1328         $this->assertEquals('2007-11-21 01:35:47', $comments[2]->comment_date_gmt); 
    1329         $this->assertEquals('0', $comments[2]->comment_karma); 
    1330         $this->assertEquals('1', $comments[2]->comment_approved); 
    1331         $this->assertEquals('', $comments[2]->comment_agent); 
    1332         $this->assertEquals('pingback', $comments[2]->comment_type); 
    1333         $this->assertEquals('0', $comments[2]->comment_parent); 
    1334         $this->assertEquals('', $comments[2]->comment_user_id); 
    1335         $this->assertEquals('Ping 1 &laquo; What&#8217;s a tellyworth?', $comments[3]->comment_author); 
    1336         $this->assertEquals('', $comments[3]->comment_author_email); 
    1337         $this->assertEquals('http://tellyworth.wordpress.com/2007/11/21/ping-1/', $comments[3]->comment_author_url); 
    1338         $this->assertEquals('72.232.101.12', $comments[3]->comment_author_IP); 
    1339         $this->assertEquals('2007-11-21 11:31:12', $comments[3]->comment_date); 
    1340         $this->assertEquals('2007-11-21 01:31:12', $comments[3]->comment_date_gmt); 
    1341         $this->assertEquals('0', $comments[3]->comment_karma); 
    1342         $this->assertEquals('1', $comments[3]->comment_approved); 
    1343         $this->assertEquals('', $comments[3]->comment_agent); 
    1344         $this->assertEquals('pingback', $comments[3]->comment_type); 
    1345         $this->assertEquals('0', $comments[3]->comment_parent); 
    1346         $this->assertEquals('', $comments[3]->comment_user_id); 
    1347  
    1348  
    1349         $post = $this->posts[26]; 
    1350         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1351         $this->assertEquals("2007-09-04 10:15:26", $post->post_date); 
    1352         $this->assertEquals("2007-09-04 00:15:26", $post->post_date_gmt); 
    1353         $this->assertEquals("A post with a single trackback.", $post->post_content); 
    1354         $this->assertEquals("One trackback", $post->post_title); 
    1355         $this->assertEquals("0", $post->post_category); 
    1356         $this->assertEquals("", $post->post_excerpt); 
    1357         $this->assertEquals("publish", $post->post_status); 
    1358         $this->assertEquals("open", $post->comment_status); 
    1359         $this->assertEquals("open", $post->ping_status); 
    1360         $this->assertEquals("", $post->post_password); 
    1361         $this->assertEquals("one-trackback", $post->post_name); 
    1362         $this->assertEquals("", $post->to_ping); 
    1363         $this->assertEquals("", $post->pinged); 
    1364         $this->assertEquals("2007-09-04 10:15:26", $post->post_modified); 
    1365         $this->assertEquals("2007-09-04 00:15:26", $post->post_modified_gmt); 
    1366         $this->assertEquals("", $post->post_content_filtered); 
    1367         $this->assertEquals("0", $post->post_parent); 
    1368         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/one-trackback/", $post->guid); 
    1369         $this->assertEquals("0", $post->menu_order); 
    1370         $this->assertEquals("post", $post->post_type); 
    1371         $this->assertEquals("", $post->post_mime_type); 
    1372         $this->assertEquals("1", $post->comment_count); 
    1373         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1374         $this->assertEquals(1, count($cats)); 
    1375         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1376         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1377         $tags = wp_get_post_tags($post->ID); 
    1378         $this->assertEquals(0, count($tags)); 
    1379         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1380         $this->assertEquals(1, count($comments)); 
    1381         $this->assertEquals('Another ping test &laquo; What&#8217;s a tellyworth?', $comments[0]->comment_author); 
    1382         $this->assertEquals('', $comments[0]->comment_author_email); 
    1383         $this->assertEquals('http://tellyworth.wordpress.com/2007/09/13/another-ping-test/', $comments[0]->comment_author_url); 
    1384         $this->assertEquals('72.232.101.12', $comments[0]->comment_author_IP); 
    1385         $this->assertEquals('2007-09-13 18:47:43', $comments[0]->comment_date); 
    1386         $this->assertEquals('2007-09-13 08:47:43', $comments[0]->comment_date_gmt); 
    1387         $this->assertEquals('0', $comments[0]->comment_karma); 
    1388         $this->assertEquals('1', $comments[0]->comment_approved); 
    1389         $this->assertEquals('', $comments[0]->comment_agent); 
    1390         $this->assertEquals('pingback', $comments[0]->comment_type); 
    1391         $this->assertEquals('0', $comments[0]->comment_parent); 
    1392         $this->assertEquals('', $comments[0]->comment_user_id); 
    1393  
    1394  
    1395         $post = $this->posts[27]; 
    1396         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1397         $this->assertEquals("2007-09-04 10:11:37", $post->post_date); 
    1398         $this->assertEquals("2007-09-04 00:11:37", $post->post_date_gmt); 
    1399         $this->assertEquals("Here's a post with some comments.", $post->post_content); 
    1400         $this->assertEquals("Comment test", $post->post_title); 
    1401         $this->assertEquals("0", $post->post_category); 
    1402         $this->assertEquals("", $post->post_excerpt); 
    1403         $this->assertEquals("publish", $post->post_status); 
    1404         $this->assertEquals("open", $post->comment_status); 
    1405         $this->assertEquals("open", $post->ping_status); 
    1406         $this->assertEquals("", $post->post_password); 
    1407         $this->assertEquals("comment-test", $post->post_name); 
    1408         $this->assertEquals("", $post->to_ping); 
    1409         $this->assertEquals("", $post->pinged); 
    1410         $this->assertEquals("2007-09-04 10:11:37", $post->post_modified); 
    1411         $this->assertEquals("2007-09-04 00:11:37", $post->post_modified_gmt); 
    1412         $this->assertEquals("", $post->post_content_filtered); 
    1413         $this->assertEquals("0", $post->post_parent); 
    1414         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/comment-test/", $post->guid); 
    1415         $this->assertEquals("0", $post->menu_order); 
    1416         $this->assertEquals("post", $post->post_type); 
    1417         $this->assertEquals("", $post->post_mime_type); 
    1418         $this->assertEquals("10", $post->comment_count); 
    1419         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1420         $this->assertEquals(1, count($cats)); 
    1421         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1422         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1423         $tags = wp_get_post_tags($post->ID); 
    1424         $this->assertEquals(0, count($tags)); 
    1425         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1426         $this->assertEquals(12, count($comments)); 
    1427         $this->assertEquals('Joseph Scott', $comments[0]->comment_author); 
    1428         $this->assertEquals('joseph@randomnetworks.com', $comments[0]->comment_author_email); 
    1429         $this->assertEquals('http://joseph.randomnetworks.com/', $comments[0]->comment_author_url); 
    1430         $this->assertEquals('63.226.101.77', $comments[0]->comment_author_IP); 
    1431         $this->assertEquals('2007-12-08 07:24:25', $comments[0]->comment_date); 
    1432         $this->assertEquals('2007-12-07 21:24:25', $comments[0]->comment_date_gmt); 
    1433         $this->assertEquals('0', $comments[0]->comment_karma); 
    1434         $this->assertEquals('0', $comments[0]->comment_approved); 
    1435         $this->assertEquals('', $comments[0]->comment_agent); 
    1436         $this->assertEquals('', $comments[0]->comment_type); 
    1437         $this->assertEquals('0', $comments[0]->comment_parent); 
    1438         $this->assertEquals('', $comments[0]->comment_user_id); 
    1439         $this->assertEquals('pinging like a microwave &laquo; no kubrick allowed', $comments[1]->comment_author); 
    1440         $this->assertEquals('', $comments[1]->comment_author_email); 
    1441         $this->assertEquals('http://ntutest.wordpress.com/2007/11/19/pinging-like-a-microwave/', $comments[1]->comment_author_url); 
    1442         $this->assertEquals('72.232.131.29', $comments[1]->comment_author_IP); 
    1443         $this->assertEquals('2007-11-20 03:44:15', $comments[1]->comment_date); 
    1444         $this->assertEquals('2007-11-19 17:44:15', $comments[1]->comment_date_gmt); 
    1445         $this->assertEquals('0', $comments[1]->comment_karma); 
    1446         $this->assertEquals('0', $comments[1]->comment_approved); 
    1447         $this->assertEquals('', $comments[1]->comment_agent); 
    1448         $this->assertEquals('pingback', $comments[1]->comment_type); 
    1449         $this->assertEquals('0', $comments[1]->comment_parent); 
    1450         $this->assertEquals('', $comments[1]->comment_user_id); 
    1451         $this->assertEquals('mdawaffe', $comments[2]->comment_author); 
    1452         $this->assertEquals('wpcom@blogwaffe.com', $comments[2]->comment_author_email); 
    1453         $this->assertEquals('http://blogwaffe.com', $comments[2]->comment_author_url); 
    1454         $this->assertEquals('71.80.169.225', $comments[2]->comment_author_IP); 
    1455         $this->assertEquals('2007-09-04 16:51:33', $comments[2]->comment_date); 
    1456         $this->assertEquals('2007-09-04 06:51:33', $comments[2]->comment_date_gmt); 
    1457         $this->assertEquals('0', $comments[2]->comment_karma); 
    1458         $this->assertEquals('1', $comments[2]->comment_approved); 
    1459         $this->assertEquals('', $comments[2]->comment_agent); 
    1460         $this->assertEquals('', $comments[2]->comment_type); 
    1461         $this->assertEquals('0', $comments[2]->comment_parent); 
    1462         $this->assertEquals('', $comments[2]->comment_user_id); 
    1463         $this->assertEquals('Alex Shiels', $comments[3]->comment_author); 
    1464         $this->assertEquals('tellyworth@gmail.com', $comments[3]->comment_author_email); 
    1465         $this->assertEquals('http://flightpath.wordpress.com/', $comments[3]->comment_author_url); 
    1466         $this->assertEquals('59.167.157.3', $comments[3]->comment_author_IP); 
    1467         $this->assertEquals('2007-09-04 13:26:26', $comments[3]->comment_date); 
    1468         $this->assertEquals('2007-09-04 03:26:26', $comments[3]->comment_date_gmt); 
    1469         $this->assertEquals('0', $comments[3]->comment_karma); 
    1470         $this->assertEquals('1', $comments[3]->comment_approved); 
    1471         $this->assertEquals('', $comments[3]->comment_agent); 
    1472         $this->assertEquals('', $comments[3]->comment_type); 
    1473         $this->assertEquals('0', $comments[3]->comment_parent); 
    1474         $this->assertEquals('', $comments[3]->comment_user_id); 
    1475         $this->assertEquals('test test', $comments[4]->comment_author); 
    1476         $this->assertEquals('', $comments[4]->comment_author_email); 
    1477         $this->assertEquals('http://tellyworthtest.wordpress.com/2007/10/15/ping-test-2/', $comments[4]->comment_author_url); 
    1478         $this->assertEquals('72.232.101.12', $comments[4]->comment_author_IP); 
    1479         $this->assertEquals('2007-09-04 11:04:01', $comments[4]->comment_date); 
    1480         $this->assertEquals('2007-09-04 01:04:01', $comments[4]->comment_date_gmt); 
    1481         $this->assertEquals('0', $comments[4]->comment_karma); 
    1482         $this->assertEquals('1', $comments[4]->comment_approved); 
    1483         $this->assertEquals('', $comments[4]->comment_agent); 
    1484         $this->assertEquals('trackback', $comments[4]->comment_type); 
    1485         $this->assertEquals('0', $comments[4]->comment_parent); 
    1486         $this->assertEquals('', $comments[4]->comment_user_id); 
    1487         $this->assertEquals('tellyworthtest2', $comments[5]->comment_author); 
    1488         $this->assertEquals('tellyworth+test2@gmail.com', $comments[5]->comment_author_email); 
    1489         $this->assertEquals('', $comments[5]->comment_author_url); 
    1490         $this->assertEquals('59.167.157.3', $comments[5]->comment_author_IP); 
    1491         $this->assertEquals('2007-09-04 10:45:21', $comments[5]->comment_date); 
    1492         $this->assertEquals('2007-09-04 00:45:21', $comments[5]->comment_date_gmt); 
    1493         $this->assertEquals('0', $comments[5]->comment_karma); 
    1494         $this->assertEquals('1', $comments[5]->comment_approved); 
    1495         $this->assertEquals('', $comments[5]->comment_agent); 
    1496         $this->assertEquals('', $comments[5]->comment_type); 
    1497         $this->assertEquals('0', $comments[5]->comment_parent); 
    1498         $this->assertEquals('', $comments[5]->comment_user_id); 
    1499         $this->assertEquals('tellyworthtest1', $comments[6]->comment_author); 
    1500         $this->assertEquals('tellyworth+test1@gmail.com', $comments[6]->comment_author_email); 
    1501         $this->assertEquals('', $comments[6]->comment_author_url); 
    1502         $this->assertEquals('59.167.157.3', $comments[6]->comment_author_IP); 
    1503         $this->assertEquals('2007-09-04 10:35:33', $comments[6]->comment_date); 
    1504         $this->assertEquals('2007-09-04 00:35:33', $comments[6]->comment_date_gmt); 
    1505         $this->assertEquals('0', $comments[6]->comment_karma); 
    1506         $this->assertEquals('1', $comments[6]->comment_approved); 
    1507         $this->assertEquals('', $comments[6]->comment_agent); 
    1508         $this->assertEquals('', $comments[6]->comment_type); 
    1509         $this->assertEquals('0', $comments[6]->comment_parent); 
    1510         $this->assertEquals('', $comments[6]->comment_user_id); 
    1511         $this->assertEquals('Lloyd Budd', $comments[7]->comment_author); 
    1512         $this->assertEquals('foolswisdom@gmail.com', $comments[7]->comment_author_email); 
    1513         $this->assertEquals('http://foolswisdom.com', $comments[7]->comment_author_url); 
    1514         $this->assertEquals('24.68.153.74', $comments[7]->comment_author_IP); 
    1515         $this->assertEquals('2007-09-04 10:23:10', $comments[7]->comment_date); 
    1516         $this->assertEquals('2007-09-04 00:23:10', $comments[7]->comment_date_gmt); 
    1517         $this->assertEquals('0', $comments[7]->comment_karma); 
    1518         $this->assertEquals('1', $comments[7]->comment_approved); 
    1519         $this->assertEquals('', $comments[7]->comment_agent); 
    1520         $this->assertEquals('', $comments[7]->comment_type); 
    1521         $this->assertEquals('0', $comments[7]->comment_parent); 
    1522         $this->assertEquals('', $comments[7]->comment_user_id); 
    1523         $this->assertEquals('tellyworthtest', $comments[8]->comment_author); 
    1524         $this->assertEquals('tellyworth+test@gmail.com', $comments[8]->comment_author_email); 
    1525         $this->assertEquals('http://', $comments[8]->comment_author_url); 
    1526         $this->assertEquals('59.167.157.3', $comments[8]->comment_author_IP); 
    1527         $this->assertEquals('2007-09-04 10:18:04', $comments[8]->comment_date); 
    1528         $this->assertEquals('2007-09-04 00:18:04', $comments[8]->comment_date_gmt); 
    1529         $this->assertEquals('0', $comments[8]->comment_karma); 
    1530         $this->assertEquals('1', $comments[8]->comment_approved); 
    1531         $this->assertEquals('', $comments[8]->comment_agent); 
    1532         $this->assertEquals('', $comments[8]->comment_type); 
    1533         $this->assertEquals('0', $comments[8]->comment_parent); 
    1534         $this->assertEquals('', $comments[8]->comment_user_id); 
    1535         $this->assertEquals('Matt', $comments[9]->comment_author); 
    1536         $this->assertEquals('m@mullenweg.com', $comments[9]->comment_author_email); 
    1537         $this->assertEquals('http://photomatt.net/', $comments[9]->comment_author_url); 
    1538         $this->assertEquals('59.167.157.3', $comments[9]->comment_author_IP); 
    1539         $this->assertEquals('2007-09-04 10:15:32', $comments[9]->comment_date); 
    1540         $this->assertEquals('2007-09-04 00:15:32', $comments[9]->comment_date_gmt); 
    1541         $this->assertEquals('0', $comments[9]->comment_karma); 
    1542         $this->assertEquals('1', $comments[9]->comment_approved); 
    1543         $this->assertEquals('', $comments[9]->comment_agent); 
    1544         $this->assertEquals('', $comments[9]->comment_type); 
    1545         $this->assertEquals('0', $comments[9]->comment_parent); 
    1546         $this->assertEquals('', $comments[9]->comment_user_id); 
    1547         $this->assertEquals('Anon', $comments[10]->comment_author); 
    1548         $this->assertEquals('nobody@example.com', $comments[10]->comment_author_email); 
    1549         $this->assertEquals('', $comments[10]->comment_author_url); 
    1550         $this->assertEquals('59.167.157.3', $comments[10]->comment_author_IP); 
    1551         $this->assertEquals('2007-09-04 10:14:19', $comments[10]->comment_date); 
    1552         $this->assertEquals('2007-09-04 00:14:19', $comments[10]->comment_date_gmt); 
    1553         $this->assertEquals('0', $comments[10]->comment_karma); 
    1554         $this->assertEquals('1', $comments[10]->comment_approved); 
    1555         $this->assertEquals('', $comments[10]->comment_agent); 
    1556         $this->assertEquals('', $comments[10]->comment_type); 
    1557         $this->assertEquals('0', $comments[10]->comment_parent); 
    1558         $this->assertEquals('', $comments[10]->comment_user_id); 
    1559         $this->assertEquals('Alex Shiels', $comments[11]->comment_author); 
    1560         $this->assertEquals('tellyworth@gmail.com', $comments[11]->comment_author_email); 
    1561         $this->assertEquals('http://flightpath.wordpress.com/', $comments[11]->comment_author_url); 
    1562         $this->assertEquals('59.167.157.3', $comments[11]->comment_author_IP); 
    1563         $this->assertEquals('2007-09-04 10:12:13', $comments[11]->comment_date); 
    1564         $this->assertEquals('2007-09-04 00:12:13', $comments[11]->comment_date_gmt); 
    1565         $this->assertEquals('0', $comments[11]->comment_karma); 
    1566         $this->assertEquals('1', $comments[11]->comment_approved); 
    1567         $this->assertEquals('', $comments[11]->comment_agent); 
    1568         $this->assertEquals('', $comments[11]->comment_type); 
    1569         $this->assertEquals('0', $comments[11]->comment_parent); 
    1570         $this->assertEquals('', $comments[11]->comment_user_id); 
    1571  
    1572  
    1573         $post = $this->posts[28]; 
    1574         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1575         $this->assertEquals("2007-09-04 09:55:04", $post->post_date); 
    1576         $this->assertEquals("2007-09-03 23:55:04", $post->post_date_gmt); 
    1577         $this->assertEquals("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sapien. Quisque suscipit tincidunt ipsum. Pellentesque ac nisi blandit tellus eleifend vulputate. Donec fermentum dolor nec pede. Phasellus pede. Sed ut odio. Etiam pharetra neque auctor sapien. Ut dolor lacus, pharetra vitae, dignissim sit amet, fringilla eu, tellus. Etiam vestibulum. Cras risus felis, interdum ac, ullamcorper id, euismod id, augue. Quisque tristique risus quis arcu. Pellentesque id nisl sed turpis dapibus eleifend. Aliquam non urna. In dictum commodo felis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Fusce hendrerit. Nullam ligula nunc, placerat a, ultrices in, pellentesque at, tortor. Nunc volutpat justo vestibulum sem. Aenean tincidunt sem sed nibh.Nullam commodo, diam sodales porta aliquet, metus erat interdum massa, vel tristique lacus orci et arcu. Aliquam erat volutpat. Aliquam est orci, varius quis, dictum ut, egestas sed, tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sodales dictum enim. In lorem sem, ultricies vel, eleifend eu, rhoncus a, nibh. In hac habitasse platea dictumst. Nam aliquam porta quam. Suspendisse id magna. Sed pulvinar ante eget erat. Nunc mauris tortor, venenatis hendrerit, blandit et, dapibus ut, enim. Etiam est diam, nonummy at, porta at, hendrerit in, ligula. Maecenas ut arcu vitae lacus gravida tristique. Phasellus venenatis. Suspendisse tortor augue, accumsan et, dapibus sed, tempor non, urna. Integer eget magna.<!--more-->Ut sit amet nisl. Suspendisse potenti. Praesent at nisl sit amet lacus suscipit fermentum. Integer non purus at nisi elementum mattis. Mauris eleifend. Donec viverra varius lectus. Nullam erat. Nam vestibulum purus. Curabitur vel dolor sed odio egestas cursus. Nam justo nisl, dictum semper, pharetra vel, dapibus sed, arcu.Mauris at nisi. Praesent imperdiet ante id nisi. Donec sed metus eu magna pulvinar convallis. Duis at arcu sed nulla lobortis dictum. Maecenas egestas. Vivamus vulputate tellus eget sapien. Vestibulum quis lectus in felis ultricies bibendum. Aenean tincidunt. Cras mollis. Maecenas auctor. Pellentesque nonummy. Sed odio ante, consequat vitae, auctor auctor, euismod sit amet, augue. Fusce ullamcorper sollicitudin urna.<!--nextpage-->Suspendisse cursus metus in velit. Aliquam nulla odio, posuere in, fermentum at, eleifend at, felis. Sed velit quam, vehicula ut, nonummy vel, vulputate hendrerit, nibh. Mauris aliquam sapien at odio. Maecenas turpis ipsum, condimentum a, dictum at, convallis et, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent posuere. Nunc ac dui eget tellus vehicula lobortis. Vestibulum molestie neque vel nisi.Etiam adipiscing est luctus neque. Ut lorem ante, molestie a, vestibulum ut, consequat sed, ipsum. Mauris in lorem a ligula tincidunt dapibus. Nunc feugiat. Nullam a nisl. Sed iaculis, dolor vitae tincidunt scelerisque, erat elit volutpat est, eget elementum arcu pede vitae sapien. Nunc iaculis, velit vitae convallis vehicula, neque dolor ornare pede, sed fermentum nisl nulla nonummy lorem. Praesent erat leo, porttitor nec, adipiscing eu, pellentesque a, erat. Aenean facilisis, nisi ac placerat varius, nibh pede nonummy nisl, vitae interdum felis urna at sem. Vestibulum eu dui non pede tempus feugiat. Nunc sed pede. Pellentesque rutrum lobortis mi. Nulla nulla mauris, feugiat porta, tempor nec, accumsan vel, nisi. Integer tincidunt. Praesent orci. Nulla facilisi. Morbi velit arcu, tristique in, porttitor sit amet, consectetuer ac, sapien. Ut tincidunt eros et augue.<!--nextpage-->Proin eu nisi. Sed suscipit mollis elit. Phasellus et tortor. Etiam nisi dui, suscipit sed, imperdiet ac, iaculis ac, dui. Donec hendrerit. Suspendisse laoreet condimentum ipsum. In vestibulum, metus sed malesuada sagittis, justo mauris aliquam mi, a dignissim erat odio eleifend eros. Ut accumsan, eros nec tempus tincidunt, turpis risus egestas nunc, eget porttitor libero sem id neque. Proin aliquet diam quis est. Proin euismod fermentum dolor. Ut imperdiet scelerisque nulla. Maecenas massa risus, aliquet vel, sagittis ac, convallis at, quam. Phasellus ac nisi a tellus aliquam lacinia. Ut ut mauris. Etiam malesuada turpis ut lacus. Sed pretium posuere eros. Mauris dapibus, augue a dictum imperdiet, tellus sem consequat dui, in viverra arcu justo quis justo. Donec ultrices commodo tellus. Fusce vitae pede. Pellentesque vel lectus ac quam fermentum rutrum.Donec varius nunc ac nunc. Duis tortor. Pellentesque imperdiet est at ante. Morbi felis eros, sollicitudin sodales, sodales vitae, mattis vitae, lorem. Donec odio sapien, venenatis at, molestie id, hendrerit a, quam. Sed suscipit justo eget augue. Praesent ornare, nisi ac blandit mollis, mauris leo ultricies nunc, quis tincidunt mi pede in metus. Suspendisse potenti. Nunc aliquet. Donec eu nibh. Sed libero ipsum, sagittis eget, commodo eu, lacinia eu, ante. Cras felis enim, convallis ornare, consectetuer vel, dapibus at, diam.<!--nextpage-->Donec venenatis, eros eget molestie adipiscing, quam massa pretium nulla, in semper nunc justo consequat velit. Duis vitae nisl ac arcu tristique tristique. Etiam enim quam, tempus nec, placerat a, faucibus sed, nisl. Quisque quis sem ac sapien vulputate aliquet. Nunc bibendum odio a leo. Cras dignissim egestas tortor. Pellentesque sagittis, velit eu ultricies luctus, turpis erat condimentum velit, vitae dictum est lorem quis nibh. In mi dolor, mollis eget, lobortis et, convallis non, erat. Morbi rutrum, ligula eu viverra eleifend, mauris massa dapibus mi, sed varius urna ante ut arcu. Praesent et erat.Nullam egestas. Pellentesque rutrum, elit ac ultricies accumsan, leo ipsum blandit metus, ac adipiscing turpis ligula nec metus. Phasellus posuere. Nunc venenatis. Cras consequat dui ac tellus. Vestibulum ultrices dapibus nunc. Sed ut nisl in elit tincidunt faucibus. Nulla arcu. Nunc pulvinar. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In sit amet erat eu ipsum consectetuer vehicula. Nulla iaculis ligula vitae odio. Donec nunc. Etiam vel ante. Quisque mollis erat a leo. Ut eget dui. Cras quis orci egestas ante aliquam fermentum. In vehicula dapibus sem. Sed ultrices odio non dui laoreet viverra.", $post->post_content); 
    1578         $this->assertEquals("A post with multiple pages", $post->post_title); 
    1579         $this->assertEquals("0", $post->post_category); 
    1580         $this->assertEquals("", $post->post_excerpt); 
    1581         $this->assertEquals("publish", $post->post_status); 
    1582         $this->assertEquals("open", $post->comment_status); 
    1583         $this->assertEquals("open", $post->ping_status); 
    1584         $this->assertEquals("", $post->post_password); 
    1585         $this->assertEquals("a-post-with-multiple-pages", $post->post_name); 
    1586         $this->assertEquals("", $post->to_ping); 
    1587         $this->assertEquals("", $post->pinged); 
    1588         $this->assertEquals("2007-09-04 09:55:04", $post->post_modified); 
    1589         $this->assertEquals("2007-09-03 23:55:04", $post->post_modified_gmt); 
    1590         $this->assertEquals("", $post->post_content_filtered); 
    1591         $this->assertEquals("0", $post->post_parent); 
    1592         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/a-post-with-several-more-tags/", $post->guid); 
    1593         $this->assertEquals("0", $post->menu_order); 
    1594         $this->assertEquals("post", $post->post_type); 
    1595         $this->assertEquals("", $post->post_mime_type); 
    1596         $this->assertEquals("0", $post->comment_count); 
    1597         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1598         $this->assertEquals(1, count($cats)); 
    1599         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1600         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1601         $tags = wp_get_post_tags($post->ID); 
    1602         $this->assertEquals(0, count($tags)); 
    1603         $this->assertEquals(array ( 
    1604   0 => 'a-post-with-several-more-tags', 
    1605 ), get_post_meta($post->ID, '_wp_old_slug', false)); 
    1606         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1607         $this->assertEquals(0, count($comments)); 
    1608  
    1609  
    1610         $post = $this->posts[29]; 
    1611         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1612         $this->assertEquals("2007-09-04 09:53:18", $post->post_date); 
    1613         $this->assertEquals("2007-09-03 23:53:18", $post->post_date_gmt); 
    1614         $this->assertEquals("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec mollis. Quisque convallis libero in sapien pharetra tincidunt. Aliquam elit ante, malesuada id, tempor eu, gravida id, odio. Maecenas suscipit, risus et eleifend imperdiet, nisi orci ullamcorper massa, et adipiscing orci velit quis magna. Praesent sit amet ligula id orci venenatis auctor. Phasellus porttitor, metus non tincidunt dapibus, orci pede pretium neque, sit amet adipiscing ipsum lectus et libero. Aenean bibendum. Curabitur mattis quam id urna. Vivamus dui. Donec nonummy lacinia lorem. Cras risus arcu, sodales ac, ultrices ac, mollis quis, justo. Sed a libero. Quisque risus erat, posuere at, tristique non, lacinia quis, eros.\n\n<!--more-->\n\nCras volutpat, lacus quis semper pharetra, nisi enim dignissim est, et sollicitudin quam ipsum vel mi. Sed commodo urna ac urna. Nullam eu tortor. Curabitur sodales scelerisque magna. Donec ultricies tristique pede. Nullam libero. Nam sollicitudin felis vel metus. Nullam posuere molestie metus. Nullam molestie, nunc id suscipit rhoncus, felis mi vulputate lacus, a ultrices tortor dolor eget augue. Aenean ultricies felis ut turpis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse placerat tellus ac nulla. Proin adipiscing sem ac risus. Maecenas nisi. Cras semper.\n\nPraesent interdum mollis neque. In egestas nulla eget pede. Integer eu purus sed diam dictum scelerisque. Morbi cursus velit et felis. Maecenas faucibus aliquet erat. In aliquet rhoncus tellus. Integer auctor nibh a nunc fringilla tempus. Cras turpis urna, dignissim vel, suscipit pulvinar, rutrum quis, sem. Ut lobortis convallis dui. Sed nonummy orci a justo. Morbi nec diam eget eros eleifend tincidunt.\n\nCurabitur non elit. Pellentesque iaculis, nisl non aliquet adipiscing, purus urna aliquet orci, sed sodales pede neque at massa. Pellentesque laoreet, enim eget varius mollis, sapien erat suscipit metus, sit amet iaculis nulla sapien id felis. Aliquam erat volutpat. Nam congue nulla a ligula. Morbi tempor hendrerit erat. Curabitur augue. Vestibulum nulla est, commodo et, fringilla quis, bibendum eget, ipsum. Suspendisse pulvinar iaculis ante. Mauris dignissim ante quis nisi. Aliquam ante mi, aliquam et, pellentesque ac, dapibus et, enim. In vulputate justo vel magna. Phasellus imperdiet justo. Proin odio orci, dapibus id, porta a, pellentesque id, erat. Aliquam erat volutpat. Mauris nonummy varius libero. Sed dolor ipsum, tempor non, aliquet et, pulvinar quis, dui. Pellentesque mauris diam, lobortis id, varius varius, facilisis at, nulla.\n\nCras pede. Nullam id velit sit amet turpis tincidunt sagittis. Nunc malesuada. Nunc consequat scelerisque odio. Donec eu leo. Nunc pellentesque felis sed odio. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus lobortis metus in lectus. Cras mollis quam eget sapien. Pellentesque non lorem sit amet sem lacinia euismod.\n\nNulla eget diam eget leo imperdiet consequat. Morbi nunc magna, pellentesque eu, porta at, ultricies ut, neque. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In tincidunt. Praesent ut orci id eros congue ultrices. Mauris non neque. Donec nulla ante, molestie sit amet, fermentum nec, blandit sit amet, purus. Fusce eget diam eu odio iaculis mollis. Phasellus consectetuer pede quis nisi. Proin non sem ut elit pulvinar faucibus. In a turpis nec augue fringilla elementum.\n\nNullam felis. Donec in nulla. Suspendisse sodales, turpis in suscipit ullamcorper, enim nunc sagittis risus, eu auctor velit tortor ut turpis. Mauris id augue at neque aliquam eleifend. Sed eget augue. Nunc faucibus ligula sed massa. Etiam non nulla. Etiam accumsan ullamcorper nisl. In pharetra massa at nunc. Nunc elementum. Duis sodales enim nec libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent dapibus eros sodales urna. Duis magna nisi, lobortis quis, tincidunt rutrum, posuere non, ipsum.\n\nAliquam convallis neque vitae diam. In diam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis fermentum arcu in tortor. Sed nibh leo, rhoncus eu, fermentum et, scelerisque ac, massa. Cras id turpis. Etiam commodo sem luctus lorem. Morbi at mi. In rutrum. Aenean luctus pede euismod tortor. Phasellus dictum. Cras neque justo, venenatis sit amet, tristique et, vulputate in, dui. Etiam sed mi gravida sapien imperdiet dictum. Aliquam gravida orci a tortor. Donec tempor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus risus ante, pellentesque vitae, luctus eget, scelerisque sed, libero. Donec massa.\n\nDonec libero mauris, volutpat at, convallis vel, laoreet euismod, augue. In accumsan malesuada risus. Mauris metus magna, condimentum in, nonummy non, ornare eu, velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin posuere. Proin rhoncus rutrum lorem. Phasellus dignissim massa non libero volutpat tincidunt. In hac habitasse platea dictumst. Phasellus eget eros. Nulla in nulla. Vivamus quis mauris. Maecenas pharetra rhoncus tellus. Sed sit amet lacus.\n\nQuisque interdum felis a tellus. Aliquam sed diam ac velit aliquam rutrum. Morbi commodo, risus a pulvinar adipiscing, tortor pede posuere risus, ac ornare tellus massa nec lectus. Vivamus mollis metus ac sapien. Nam sed est a libero ullamcorper dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean a erat ac nibh accumsan volutpat. Phasellus pulvinar consequat turpis. Curabitur ante metus, tempus ut, consequat eu, sollicitudin sit amet, justo. Duis ut libero.", $post->post_content); 
    1615         $this->assertEquals("An article with a More tag", $post->post_title); 
    1616         $this->assertEquals("0", $post->post_category); 
    1617         $this->assertEquals("", $post->post_excerpt); 
    1618         $this->assertEquals("publish", $post->post_status); 
    1619         $this->assertEquals("open", $post->comment_status); 
    1620         $this->assertEquals("open", $post->ping_status); 
    1621         $this->assertEquals("", $post->post_password); 
    1622         $this->assertEquals("lorem-ipsum", $post->post_name); 
    1623         $this->assertEquals("", $post->to_ping); 
    1624         $this->assertEquals("", $post->pinged); 
    1625         $this->assertEquals("2007-09-04 09:53:18", $post->post_modified); 
    1626         $this->assertEquals("2007-09-03 23:53:18", $post->post_modified_gmt); 
    1627         $this->assertEquals("", $post->post_content_filtered); 
    1628         $this->assertEquals("0", $post->post_parent); 
    1629         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/lorem-ipsum/", $post->guid); 
    1630         $this->assertEquals("0", $post->menu_order); 
    1631         $this->assertEquals("post", $post->post_type); 
    1632         $this->assertEquals("", $post->post_mime_type); 
    1633         $this->assertEquals("0", $post->comment_count); 
    1634         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1635         $this->assertEquals(1, count($cats)); 
    1636         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1637         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1638         $tags = wp_get_post_tags($post->ID); 
    1639         $this->assertEquals(0, count($tags)); 
    1640         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1641         $this->assertEquals(0, count($comments)); 
    1642  
    1643  
    1644         $post = $this->posts[30]; 
    1645         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1646         $this->assertEquals("2007-09-04 09:52:50", $post->post_date); 
    1647         $this->assertEquals("2007-09-03 23:52:50", $post->post_date_gmt); 
    1648         $this->assertEquals("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec mollis. Quisque convallis libero in sapien pharetra tincidunt. Aliquam elit ante, malesuada id, tempor eu, gravida id, odio. Maecenas suscipit, risus et eleifend imperdiet, nisi orci ullamcorper massa, et adipiscing orci velit quis magna. Praesent sit amet ligula id orci venenatis auctor. Phasellus porttitor, metus non tincidunt dapibus, orci pede pretium neque, sit amet adipiscing ipsum lectus et libero. Aenean bibendum. Curabitur mattis quam id urna. Vivamus dui. Donec nonummy lacinia lorem. Cras risus arcu, sodales ac, ultrices ac, mollis quis, justo. Sed a libero. Quisque risus erat, posuere at, tristique non, lacinia quis, eros.\n\nCras volutpat, lacus quis semper pharetra, nisi enim dignissim est, et sollicitudin quam ipsum vel mi. Sed commodo urna ac urna. Nullam eu tortor. Curabitur sodales scelerisque magna. Donec ultricies tristique pede. Nullam libero. Nam sollicitudin felis vel metus. Nullam posuere molestie metus. Nullam molestie, nunc id suscipit rhoncus, felis mi vulputate lacus, a ultrices tortor dolor eget augue. Aenean ultricies felis ut turpis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse placerat tellus ac nulla. Proin adipiscing sem ac risus. Maecenas nisi. Cras semper.\n\nPraesent interdum mollis neque. In egestas nulla eget pede. Integer eu purus sed diam dictum scelerisque. Morbi cursus velit et felis. Maecenas faucibus aliquet erat. In aliquet rhoncus tellus. Integer auctor nibh a nunc fringilla tempus. Cras turpis urna, dignissim vel, suscipit pulvinar, rutrum quis, sem. Ut lobortis convallis dui. Sed nonummy orci a justo. Morbi nec diam eget eros eleifend tincidunt.\n\nCurabitur non elit. Pellentesque iaculis, nisl non aliquet adipiscing, purus urna aliquet orci, sed sodales pede neque at massa. Pellentesque laoreet, enim eget varius mollis, sapien erat suscipit metus, sit amet iaculis nulla sapien id felis. Aliquam erat volutpat. Nam congue nulla a ligula. Morbi tempor hendrerit erat. Curabitur augue. Vestibulum nulla est, commodo et, fringilla quis, bibendum eget, ipsum. Suspendisse pulvinar iaculis ante. Mauris dignissim ante quis nisi. Aliquam ante mi, aliquam et, pellentesque ac, dapibus et, enim. In vulputate justo vel magna. Phasellus imperdiet justo. Proin odio orci, dapibus id, porta a, pellentesque id, erat. Aliquam erat volutpat. Mauris nonummy varius libero. Sed dolor ipsum, tempor non, aliquet et, pulvinar quis, dui. Pellentesque mauris diam, lobortis id, varius varius, facilisis at, nulla.\n\nCras pede. Nullam id velit sit amet turpis tincidunt sagittis. Nunc malesuada. Nunc consequat scelerisque odio. Donec eu leo. Nunc pellentesque felis sed odio. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus lobortis metus in lectus. Cras mollis quam eget sapien. Pellentesque non lorem sit amet sem lacinia euismod.\n\nNulla eget diam eget leo imperdiet consequat. Morbi nunc magna, pellentesque eu, porta at, ultricies ut, neque. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In tincidunt. Praesent ut orci id eros congue ultrices. Mauris non neque. Donec nulla ante, molestie sit amet, fermentum nec, blandit sit amet, purus. Fusce eget diam eu odio iaculis mollis. Phasellus consectetuer pede quis nisi. Proin non sem ut elit pulvinar faucibus. In a turpis nec augue fringilla elementum.\n\nNullam felis. Donec in nulla. Suspendisse sodales, turpis in suscipit ullamcorper, enim nunc sagittis risus, eu auctor velit tortor ut turpis. Mauris id augue at neque aliquam eleifend. Sed eget augue. Nunc faucibus ligula sed massa. Etiam non nulla. Etiam accumsan ullamcorper nisl. In pharetra massa at nunc. Nunc elementum. Duis sodales enim nec libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent dapibus eros sodales urna. Duis magna nisi, lobortis quis, tincidunt rutrum, posuere non, ipsum.\n\nAliquam convallis neque vitae diam. In diam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis fermentum arcu in tortor. Sed nibh leo, rhoncus eu, fermentum et, scelerisque ac, massa. Cras id turpis. Etiam commodo sem luctus lorem. Morbi at mi. In rutrum. Aenean luctus pede euismod tortor. Phasellus dictum. Cras neque justo, venenatis sit amet, tristique et, vulputate in, dui. Etiam sed mi gravida sapien imperdiet dictum. Aliquam gravida orci a tortor. Donec tempor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus risus ante, pellentesque vitae, luctus eget, scelerisque sed, libero. Donec massa.\n\nDonec libero mauris, volutpat at, convallis vel, laoreet euismod, augue. In accumsan malesuada risus. Mauris metus magna, condimentum in, nonummy non, ornare eu, velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin posuere. Proin rhoncus rutrum lorem. Phasellus dignissim massa non libero volutpat tincidunt. In hac habitasse platea dictumst. Phasellus eget eros. Nulla in nulla. Vivamus quis mauris. Maecenas pharetra rhoncus tellus. Sed sit amet lacus.\n\nQuisque interdum felis a tellus. Aliquam sed diam ac velit aliquam rutrum. Morbi commodo, risus a pulvinar adipiscing, tortor pede posuere risus, ac ornare tellus massa nec lectus. Vivamus mollis metus ac sapien. Nam sed est a libero ullamcorper dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean a erat ac nibh accumsan volutpat. Phasellus pulvinar consequat turpis. Curabitur ante metus, tempus ut, consequat eu, sollicitudin sit amet, justo. Duis ut libero.", $post->post_content); 
    1649         $this->assertEquals("Lorem Ipsum", $post->post_title); 
    1650         $this->assertEquals("0", $post->post_category); 
    1651         $this->assertEquals("", $post->post_excerpt); 
    1652         $this->assertEquals("publish", $post->post_status); 
    1653         $this->assertEquals("open", $post->comment_status); 
    1654         $this->assertEquals("open", $post->ping_status); 
    1655         $this->assertEquals("", $post->post_password); 
    1656         $this->assertEquals("lorem-ipsum", $post->post_name); 
    1657         $this->assertEquals("", $post->to_ping); 
    1658         $this->assertEquals("", $post->pinged); 
    1659         $this->assertEquals("2007-09-04 09:52:50", $post->post_modified); 
    1660         $this->assertEquals("2007-09-03 23:52:50", $post->post_modified_gmt); 
    1661         $this->assertEquals("", $post->post_content_filtered); 
    1662         $this->assertEquals("0", $post->post_parent); 
    1663         $this->assertEquals("http://asdftestblog1.wordpress.com/lorem-ipsum/", $post->guid); 
    1664         $this->assertEquals("0", $post->menu_order); 
    1665         $this->assertEquals("page", $post->post_type); 
    1666         $this->assertEquals("", $post->post_mime_type); 
    1667         $this->assertEquals("0", $post->comment_count); 
    1668         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1669         $this->assertEquals(1, count($cats)); 
    1670         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1671         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1672         $tags = wp_get_post_tags($post->ID); 
    1673         $this->assertEquals(0, count($tags)); 
    1674         $this->assertEquals(array ( 
    1675   0 => 'default', 
    1676 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1677         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1678         $this->assertEquals(0, count($comments)); 
    1679  
    1680  
    1681         $post = $this->posts[31]; 
    1682         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1683         $this->assertEquals("2007-09-04 09:52:18", $post->post_date); 
    1684         $this->assertEquals("2007-09-03 23:52:18", $post->post_date_gmt); 
    1685         $this->assertEquals("This page has a parent.", $post->post_content); 
    1686         $this->assertEquals("Child page 2", $post->post_title); 
    1687         $this->assertEquals("0", $post->post_category); 
    1688         $this->assertEquals("", $post->post_excerpt); 
    1689         $this->assertEquals("publish", $post->post_status); 
    1690         $this->assertEquals("open", $post->comment_status); 
    1691         $this->assertEquals("open", $post->ping_status); 
    1692         $this->assertEquals("", $post->post_password); 
    1693         $this->assertEquals("child-page-2", $post->post_name); 
    1694         $this->assertEquals("", $post->to_ping); 
    1695         $this->assertEquals("", $post->pinged); 
    1696         $this->assertEquals("2007-09-04 09:52:18", $post->post_modified); 
    1697         $this->assertEquals("2007-09-03 23:52:18", $post->post_modified_gmt); 
    1698         $this->assertEquals("", $post->post_content_filtered); 
    1699         $this->assertEquals($this->posts[32]->ID, $post->post_parent); 
    1700         $this->assertEquals("http://asdftestblog1.wordpress.com/parent-page/child-page-1/child-page-2/", $post->guid); 
    1701         $this->assertEquals("0", $post->menu_order); 
    1702         $this->assertEquals("page", $post->post_type); 
    1703         $this->assertEquals("", $post->post_mime_type); 
    1704         $this->assertEquals("0", $post->comment_count); 
    1705         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1706         $this->assertEquals(1, count($cats)); 
    1707         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1708         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1709         $tags = wp_get_post_tags($post->ID); 
    1710         $this->assertEquals(0, count($tags)); 
    1711         $this->assertEquals(array ( 
    1712   0 => 'default', 
    1713 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1714         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1715         $this->assertEquals(0, count($comments)); 
    1716  
    1717  
    1718         $post = $this->posts[32]; 
    1719         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1720         $this->assertEquals("2007-09-04 09:51:50", $post->post_date); 
    1721         $this->assertEquals("2007-09-03 23:51:50", $post->post_date_gmt); 
    1722         $this->assertEquals("This page has a parent and child.", $post->post_content); 
    1723         $this->assertEquals("Child page 1", $post->post_title); 
    1724         $this->assertEquals("0", $post->post_category); 
    1725         $this->assertEquals("", $post->post_excerpt); 
    1726         $this->assertEquals("publish", $post->post_status); 
    1727         $this->assertEquals("open", $post->comment_status); 
    1728         $this->assertEquals("open", $post->ping_status); 
    1729         $this->assertEquals("", $post->post_password); 
    1730         $this->assertEquals("child-page-1", $post->post_name); 
    1731         $this->assertEquals("", $post->to_ping); 
    1732         $this->assertEquals("", $post->pinged); 
    1733         $this->assertEquals("2007-09-04 09:51:50", $post->post_modified); 
    1734         $this->assertEquals("2007-09-03 23:51:50", $post->post_modified_gmt); 
    1735         $this->assertEquals("", $post->post_content_filtered); 
    1736         $this->assertEquals($this->posts[33]->ID, $post->post_parent); 
    1737         $this->assertEquals("http://asdftestblog1.wordpress.com/parent-page/child-page-1/", $post->guid); 
    1738         $this->assertEquals("0", $post->menu_order); 
    1739         $this->assertEquals("page", $post->post_type); 
    1740         $this->assertEquals("", $post->post_mime_type); 
    1741         $this->assertEquals("0", $post->comment_count); 
    1742         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1743         $this->assertEquals(1, count($cats)); 
    1744         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1745         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1746         $tags = wp_get_post_tags($post->ID); 
    1747         $this->assertEquals(0, count($tags)); 
    1748         $this->assertEquals(array ( 
    1749   0 => 'default', 
    1750 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1751         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1752         $this->assertEquals(0, count($comments)); 
    1753  
    1754  
    1755         $post = $this->posts[33]; 
    1756         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1757         $this->assertEquals("2007-09-04 09:51:09", $post->post_date); 
    1758         $this->assertEquals("2007-09-03 23:51:09", $post->post_date_gmt); 
    1759         $this->assertEquals("This page has children.", $post->post_content); 
    1760         $this->assertEquals("Parent page", $post->post_title); 
    1761         $this->assertEquals("0", $post->post_category); 
    1762         $this->assertEquals("", $post->post_excerpt); 
    1763         $this->assertEquals("publish", $post->post_status); 
    1764         $this->assertEquals("open", $post->comment_status); 
    1765         $this->assertEquals("open", $post->ping_status); 
    1766         $this->assertEquals("", $post->post_password); 
    1767         $this->assertEquals("parent-page", $post->post_name); 
    1768         $this->assertEquals("", $post->to_ping); 
    1769         $this->assertEquals("", $post->pinged); 
    1770         $this->assertEquals("2007-09-04 09:51:09", $post->post_modified); 
    1771         $this->assertEquals("2007-09-03 23:51:09", $post->post_modified_gmt); 
    1772         $this->assertEquals("", $post->post_content_filtered); 
    1773         $this->assertEquals("0", $post->post_parent); 
    1774         $this->assertEquals("http://asdftestblog1.wordpress.com/parent-page/", $post->guid); 
    1775         $this->assertEquals("0", $post->menu_order); 
    1776         $this->assertEquals("page", $post->post_type); 
    1777         $this->assertEquals("", $post->post_mime_type); 
    1778         $this->assertEquals("0", $post->comment_count); 
    1779         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1780         $this->assertEquals(1, count($cats)); 
    1781         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1782         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1783         $tags = wp_get_post_tags($post->ID); 
    1784         $this->assertEquals(0, count($tags)); 
    1785         $this->assertEquals(array ( 
    1786   0 => 'default', 
    1787 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    1788         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1789         $this->assertEquals(0, count($comments)); 
    1790  
    1791  
    1792         $post = $this->posts[34]; 
    1793         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1794         $this->assertEquals("2007-09-04 09:48:39", $post->post_date); 
    1795         $this->assertEquals("2007-09-03 23:48:39", $post->post_date_gmt); 
    1796         $this->assertEquals("", $post->post_content); 
    1797         $this->assertEquals("", $post->post_title); 
    1798         $this->assertEquals("0", $post->post_category); 
    1799         $this->assertEquals("", $post->post_excerpt); 
    1800         $this->assertEquals("inherit", $post->post_status); 
    1801         $this->assertEquals("open", $post->comment_status); 
    1802         $this->assertEquals("open", $post->ping_status); 
    1803         $this->assertEquals("", $post->post_password); 
    1804         $this->assertEquals("25", $post->post_name); 
    1805         $this->assertEquals("", $post->to_ping); 
    1806         $this->assertEquals("", $post->pinged); 
    1807         $this->assertEquals("2007-09-04 09:48:39", $post->post_modified); 
    1808         $this->assertEquals("2007-09-03 23:48:39", $post->post_modified_gmt); 
    1809         $this->assertEquals("", $post->post_content_filtered); 
    1810         $this->assertEquals($this->posts[61]->ID, $post->post_parent); 
    1811         $this->assertEquals(wp_get_attachment_url($post->ID), $post->guid); 
    1812         $this->assertEquals("0", $post->menu_order); 
    1813         $this->assertEquals("attachment", $post->post_type); 
    1814         $this->assertEquals("image/jpeg", $post->post_mime_type); 
    1815         $this->assertEquals("0", $post->comment_count); 
    1816         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1817         $this->assertEquals(1, count($cats)); 
    1818         $this->assertEquals('Uncategorized', $cats[0]->name); 
    1819         $this->assertEquals('uncategorized', $cats[0]->slug); 
    1820         $tags = wp_get_post_tags($post->ID); 
    1821         $this->assertEquals(0, count($tags)); 
    1822         $this->assertEquals(array ( 
    1823   0 => '/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4700-1.jpg', 
    1824   1 => '/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg', 
    1825 ), get_post_meta($post->ID, '_wp_attached_file', false)); 
    1826         $this->assertEquals(array ( 
    1827   0 => 's:580:"a:6:{s:5:"width";i:199;s:6:"height";i:300;s:14:"hwstring_small";s:22:"height=\'96\' width=\'63\'";s:4:"file";s:96:"/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4700-1.jpg";s:5:"thumb";s:35:"2007-06-30-dsc_4700-1.thumbnail.jpg";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183237109;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.0013333333333333332593184650249895639717578887939453125;s:5:"title";s:0:"";}}";', 
    1828   1 => 'a:6:{s:5:"width";i:199;s:6:"height";i:300;s:14:"hwstring_small";s:22:"height=\'96\' width=\'63\'";s:4:"file";s:104:"/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg";s:5:"sizes";a:1:{s:9:"thumbnail";a:3:{s:4:"file";s:33:"2007-06-30-dsc_4700-1-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}}s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183201109;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.00133333333333333328880876411659528457676060497760772705078125;s:5:"title";s:0:"";}}', 
    1829 ), get_post_meta($post->ID, '_wp_attachment_metadata', false)); 
    1830         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1831         $this->assertEquals(0, count($comments)); 
    1832  
    1833  
    1834         $post = $this->posts[35]; 
    1835         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1836         $this->assertEquals("2007-09-04 09:44:53", $post->post_date); 
    1837         $this->assertEquals("2007-09-03 23:44:53", $post->post_date_gmt); 
    1838         $this->assertEquals("Category permutations: C", $post->post_content); 
    1839         $this->assertEquals("Cat C", $post->post_title); 
    1840         $this->assertEquals("0", $post->post_category); 
    1841         $this->assertEquals("", $post->post_excerpt); 
    1842         $this->assertEquals("publish", $post->post_status); 
    1843         $this->assertEquals("open", $post->comment_status); 
    1844         $this->assertEquals("open", $post->ping_status); 
    1845         $this->assertEquals("", $post->post_password); 
    1846         $this->assertEquals("cat-c", $post->post_name); 
    1847         $this->assertEquals("", $post->to_ping); 
    1848         $this->assertEquals("", $post->pinged); 
    1849         $this->assertEquals("2007-09-04 09:44:53", $post->post_modified); 
    1850         $this->assertEquals("2007-09-03 23:44:53", $post->post_modified_gmt); 
    1851         $this->assertEquals("", $post->post_content_filtered); 
    1852         $this->assertEquals("0", $post->post_parent); 
    1853         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cat-c/", $post->guid); 
    1854         $this->assertEquals("0", $post->menu_order); 
    1855         $this->assertEquals("post", $post->post_type); 
    1856         $this->assertEquals("", $post->post_mime_type); 
    1857         $this->assertEquals("0", $post->comment_count); 
    1858         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1859         $this->assertEquals(1, count($cats)); 
    1860         $this->assertEquals('Cat C', $cats[0]->name); 
    1861         $this->assertEquals('cat-c', $cats[0]->slug); 
    1862         $tags = wp_get_post_tags($post->ID); 
    1863         $this->assertEquals(0, count($tags)); 
    1864         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1865         $this->assertEquals(0, count($comments)); 
    1866  
    1867  
    1868         $post = $this->posts[36]; 
    1869         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1870         $this->assertEquals("2007-09-04 09:44:14", $post->post_date); 
    1871         $this->assertEquals("2007-09-03 23:44:14", $post->post_date_gmt); 
    1872         $this->assertEquals("Category permutations: B", $post->post_content); 
    1873         $this->assertEquals("Cat B", $post->post_title); 
    1874         $this->assertEquals("0", $post->post_category); 
    1875         $this->assertEquals("", $post->post_excerpt); 
    1876         $this->assertEquals("publish", $post->post_status); 
    1877         $this->assertEquals("open", $post->comment_status); 
    1878         $this->assertEquals("open", $post->ping_status); 
    1879         $this->assertEquals("", $post->post_password); 
    1880         $this->assertEquals("cat-b", $post->post_name); 
    1881         $this->assertEquals("", $post->to_ping); 
    1882         $this->assertEquals("", $post->pinged); 
    1883         $this->assertEquals("2007-09-04 09:44:14", $post->post_modified); 
    1884         $this->assertEquals("2007-09-03 23:44:14", $post->post_modified_gmt); 
    1885         $this->assertEquals("", $post->post_content_filtered); 
    1886         $this->assertEquals("0", $post->post_parent); 
    1887         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cat-b/", $post->guid); 
    1888         $this->assertEquals("0", $post->menu_order); 
    1889         $this->assertEquals("post", $post->post_type); 
    1890         $this->assertEquals("", $post->post_mime_type); 
    1891         $this->assertEquals("0", $post->comment_count); 
    1892         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1893         $this->assertEquals(1, count($cats)); 
    1894         $this->assertEquals('Cat B', $cats[0]->name); 
    1895         $this->assertEquals('cat-b', $cats[0]->slug); 
    1896         $tags = wp_get_post_tags($post->ID); 
    1897         $this->assertEquals(0, count($tags)); 
    1898         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1899         $this->assertEquals(0, count($comments)); 
    1900  
    1901  
    1902         $post = $this->posts[37]; 
    1903         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1904         $this->assertEquals("2007-09-04 09:43:47", $post->post_date); 
    1905         $this->assertEquals("2007-09-03 23:43:47", $post->post_date_gmt); 
    1906         $this->assertEquals("Category permutations: A", $post->post_content); 
    1907         $this->assertEquals("Cat A", $post->post_title); 
    1908         $this->assertEquals("0", $post->post_category); 
    1909         $this->assertEquals("", $post->post_excerpt); 
    1910         $this->assertEquals("publish", $post->post_status); 
    1911         $this->assertEquals("open", $post->comment_status); 
    1912         $this->assertEquals("open", $post->ping_status); 
    1913         $this->assertEquals("", $post->post_password); 
    1914         $this->assertEquals("cat-a", $post->post_name); 
    1915         $this->assertEquals("", $post->to_ping); 
    1916         $this->assertEquals("", $post->pinged); 
    1917         $this->assertEquals("2007-09-04 09:43:47", $post->post_modified); 
    1918         $this->assertEquals("2007-09-03 23:43:47", $post->post_modified_gmt); 
    1919         $this->assertEquals("", $post->post_content_filtered); 
    1920         $this->assertEquals("0", $post->post_parent); 
    1921         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cat-a/", $post->guid); 
    1922         $this->assertEquals("0", $post->menu_order); 
    1923         $this->assertEquals("post", $post->post_type); 
    1924         $this->assertEquals("", $post->post_mime_type); 
    1925         $this->assertEquals("0", $post->comment_count); 
    1926         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1927         $this->assertEquals(1, count($cats)); 
    1928         $this->assertEquals('Cat A', $cats[0]->name); 
    1929         $this->assertEquals('cat-a', $cats[0]->slug); 
    1930         $tags = wp_get_post_tags($post->ID); 
    1931         $this->assertEquals(0, count($tags)); 
    1932         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1933         $this->assertEquals(0, count($comments)); 
    1934  
    1935  
    1936         $post = $this->posts[38]; 
    1937         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1938         $this->assertEquals("2007-09-04 09:43:14", $post->post_date); 
    1939         $this->assertEquals("2007-09-03 23:43:14", $post->post_date_gmt); 
    1940         $this->assertEquals("Category permutations: A, C.", $post->post_content); 
    1941         $this->assertEquals("Cats A and C", $post->post_title); 
    1942         $this->assertEquals("0", $post->post_category); 
    1943         $this->assertEquals("", $post->post_excerpt); 
    1944         $this->assertEquals("publish", $post->post_status); 
    1945         $this->assertEquals("open", $post->comment_status); 
    1946         $this->assertEquals("open", $post->ping_status); 
    1947         $this->assertEquals("", $post->post_password); 
    1948         $this->assertEquals("cats-a-and-c", $post->post_name); 
    1949         $this->assertEquals("", $post->to_ping); 
    1950         $this->assertEquals("", $post->pinged); 
    1951         $this->assertEquals("2007-09-04 09:43:14", $post->post_modified); 
    1952         $this->assertEquals("2007-09-03 23:43:14", $post->post_modified_gmt); 
    1953         $this->assertEquals("", $post->post_content_filtered); 
    1954         $this->assertEquals("0", $post->post_parent); 
    1955         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cats-a-and-c/", $post->guid); 
    1956         $this->assertEquals("0", $post->menu_order); 
    1957         $this->assertEquals("post", $post->post_type); 
    1958         $this->assertEquals("", $post->post_mime_type); 
    1959         $this->assertEquals("0", $post->comment_count); 
    1960         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1961         $this->assertEquals(2, count($cats)); 
    1962         $this->assertEquals('Cat A', $cats[0]->name); 
    1963         $this->assertEquals('cat-a', $cats[0]->slug); 
    1964         $this->assertEquals('Cat C', $cats[1]->name); 
    1965         $this->assertEquals('cat-c', $cats[1]->slug); 
    1966         $tags = wp_get_post_tags($post->ID); 
    1967         $this->assertEquals(0, count($tags)); 
    1968         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    1969         $this->assertEquals(0, count($comments)); 
    1970  
    1971  
    1972         $post = $this->posts[39]; 
    1973         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    1974         $this->assertEquals("2007-09-04 09:42:29", $post->post_date); 
    1975         $this->assertEquals("2007-09-03 23:42:29", $post->post_date_gmt); 
    1976         $this->assertEquals("Category permutations: B, C.", $post->post_content); 
    1977         $this->assertEquals("Cats B and C", $post->post_title); 
    1978         $this->assertEquals("0", $post->post_category); 
    1979         $this->assertEquals("", $post->post_excerpt); 
    1980         $this->assertEquals("publish", $post->post_status); 
    1981         $this->assertEquals("open", $post->comment_status); 
    1982         $this->assertEquals("open", $post->ping_status); 
    1983         $this->assertEquals("", $post->post_password); 
    1984         $this->assertEquals("cats-b-and-c", $post->post_name); 
    1985         $this->assertEquals("", $post->to_ping); 
    1986         $this->assertEquals("", $post->pinged); 
    1987         $this->assertEquals("2007-09-04 09:42:29", $post->post_modified); 
    1988         $this->assertEquals("2007-09-03 23:42:29", $post->post_modified_gmt); 
    1989         $this->assertEquals("", $post->post_content_filtered); 
    1990         $this->assertEquals("0", $post->post_parent); 
    1991         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cats-b-and-c/", $post->guid); 
    1992         $this->assertEquals("0", $post->menu_order); 
    1993         $this->assertEquals("post", $post->post_type); 
    1994         $this->assertEquals("", $post->post_mime_type); 
    1995         $this->assertEquals("0", $post->comment_count); 
    1996         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    1997         $this->assertEquals(2, count($cats)); 
    1998         $this->assertEquals('Cat B', $cats[0]->name); 
    1999         $this->assertEquals('cat-b', $cats[0]->slug); 
    2000         $this->assertEquals('Cat C', $cats[1]->name); 
    2001         $this->assertEquals('cat-c', $cats[1]->slug); 
    2002         $tags = wp_get_post_tags($post->ID); 
    2003         $this->assertEquals(0, count($tags)); 
    2004         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2005         $this->assertEquals(0, count($comments)); 
    2006  
    2007  
    2008         $post = $this->posts[40]; 
    2009         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2010         $this->assertEquals("2007-09-04 09:41:51", $post->post_date); 
    2011         $this->assertEquals("2007-09-03 23:41:51", $post->post_date_gmt); 
    2012         $this->assertEquals("Category permutations: A, B.", $post->post_content); 
    2013         $this->assertEquals("Cats A and B", $post->post_title); 
    2014         $this->assertEquals("0", $post->post_category); 
    2015         $this->assertEquals("", $post->post_excerpt); 
    2016         $this->assertEquals("publish", $post->post_status); 
    2017         $this->assertEquals("open", $post->comment_status); 
    2018         $this->assertEquals("open", $post->ping_status); 
    2019         $this->assertEquals("", $post->post_password); 
    2020         $this->assertEquals("cats-a-and-b", $post->post_name); 
    2021         $this->assertEquals("", $post->to_ping); 
    2022         $this->assertEquals("", $post->pinged); 
    2023         $this->assertEquals("2007-09-04 09:41:51", $post->post_modified); 
    2024         $this->assertEquals("2007-09-03 23:41:51", $post->post_modified_gmt); 
    2025         $this->assertEquals("", $post->post_content_filtered); 
    2026         $this->assertEquals("0", $post->post_parent); 
    2027         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cats-a-and-b/", $post->guid); 
    2028         $this->assertEquals("0", $post->menu_order); 
    2029         $this->assertEquals("post", $post->post_type); 
    2030         $this->assertEquals("", $post->post_mime_type); 
    2031         $this->assertEquals("0", $post->comment_count); 
    2032         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2033         $this->assertEquals(2, count($cats)); 
    2034         $this->assertEquals('Cat A', $cats[0]->name); 
    2035         $this->assertEquals('cat-a', $cats[0]->slug); 
    2036         $this->assertEquals('Cat B', $cats[1]->name); 
    2037         $this->assertEquals('cat-b', $cats[1]->slug); 
    2038         $tags = wp_get_post_tags($post->ID); 
    2039         $this->assertEquals(0, count($tags)); 
    2040         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2041         $this->assertEquals(0, count($comments)); 
    2042  
    2043  
    2044         $post = $this->posts[41]; 
    2045         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2046         $this->assertEquals("2007-09-04 09:41:17", $post->post_date); 
    2047         $this->assertEquals("2007-09-03 23:41:17", $post->post_date_gmt); 
    2048         $this->assertEquals("Category permutations: A, B, C.", $post->post_content); 
    2049         $this->assertEquals("Cats A, B, C", $post->post_title); 
    2050         $this->assertEquals("0", $post->post_category); 
    2051         $this->assertEquals("", $post->post_excerpt); 
    2052         $this->assertEquals("publish", $post->post_status); 
    2053         $this->assertEquals("open", $post->comment_status); 
    2054         $this->assertEquals("open", $post->ping_status); 
    2055         $this->assertEquals("", $post->post_password); 
    2056         $this->assertEquals("cats-a-b-c", $post->post_name); 
    2057         $this->assertEquals("", $post->to_ping); 
    2058         $this->assertEquals("", $post->pinged); 
    2059         $this->assertEquals("2007-09-04 09:41:17", $post->post_modified); 
    2060         $this->assertEquals("2007-09-03 23:41:17", $post->post_modified_gmt); 
    2061         $this->assertEquals("", $post->post_content_filtered); 
    2062         $this->assertEquals("0", $post->post_parent); 
    2063         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/cats-a-b-c/", $post->guid); 
    2064         $this->assertEquals("0", $post->menu_order); 
    2065         $this->assertEquals("post", $post->post_type); 
    2066         $this->assertEquals("", $post->post_mime_type); 
    2067         $this->assertEquals("0", $post->comment_count); 
    2068         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2069         $this->assertEquals(3, count($cats)); 
    2070         $this->assertEquals('Cat A', $cats[0]->name); 
    2071         $this->assertEquals('cat-a', $cats[0]->slug); 
    2072         $this->assertEquals('Cat B', $cats[1]->name); 
    2073         $this->assertEquals('cat-b', $cats[1]->slug); 
    2074         $this->assertEquals('Cat C', $cats[2]->name); 
    2075         $this->assertEquals('cat-c', $cats[2]->slug); 
    2076         $tags = wp_get_post_tags($post->ID); 
    2077         $this->assertEquals(0, count($tags)); 
    2078         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2079         $this->assertEquals(0, count($comments)); 
    2080  
    2081  
    2082         $post = $this->posts[42]; 
    2083         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2084         $this->assertEquals("2007-09-04 09:39:56", $post->post_date); 
    2085         $this->assertEquals("2007-09-03 23:39:56", $post->post_date_gmt); 
    2086         $this->assertEquals("", $post->post_content); 
    2087         $this->assertEquals("This post has no body", $post->post_title); 
    2088         $this->assertEquals("0", $post->post_category); 
    2089         $this->assertEquals("", $post->post_excerpt); 
    2090         $this->assertEquals("publish", $post->post_status); 
    2091         $this->assertEquals("open", $post->comment_status); 
    2092         $this->assertEquals("open", $post->ping_status); 
    2093         $this->assertEquals("", $post->post_password); 
    2094         $this->assertEquals("this-post-has-no-body", $post->post_name); 
    2095         $this->assertEquals("", $post->to_ping); 
    2096         $this->assertEquals("", $post->pinged); 
    2097         $this->assertEquals("2007-09-04 09:39:56", $post->post_modified); 
    2098         $this->assertEquals("2007-09-03 23:39:56", $post->post_modified_gmt); 
    2099         $this->assertEquals("", $post->post_content_filtered); 
    2100         $this->assertEquals("0", $post->post_parent); 
    2101         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/this-post-has-no-body/", $post->guid); 
    2102         $this->assertEquals("0", $post->menu_order); 
    2103         $this->assertEquals("post", $post->post_type); 
    2104         $this->assertEquals("", $post->post_mime_type); 
    2105         $this->assertEquals("0", $post->comment_count); 
    2106         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2107         $this->assertEquals(1, count($cats)); 
    2108         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2109         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2110         $tags = wp_get_post_tags($post->ID); 
    2111         $this->assertEquals(0, count($tags)); 
    2112         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2113         $this->assertEquals(0, count($comments)); 
    2114  
    2115  
    2116         $post = $this->posts[43]; 
    2117         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2118         $this->assertEquals("2007-09-04 09:39:23", $post->post_date); 
    2119         $this->assertEquals("2007-09-03 23:39:23", $post->post_date_gmt); 
    2120         $this->assertEquals("This post has no title.", $post->post_content); 
    2121         $this->assertEquals("", $post->post_title); 
    2122         $this->assertEquals("0", $post->post_category); 
    2123         $this->assertEquals("", $post->post_excerpt); 
    2124         $this->assertEquals("publish", $post->post_status); 
    2125         $this->assertEquals("open", $post->comment_status); 
    2126         $this->assertEquals("open", $post->ping_status); 
    2127         $this->assertEquals("", $post->post_password); 
    2128         $this->assertEquals("14", $post->post_name); 
    2129         $this->assertEquals("", $post->to_ping); 
    2130         $this->assertEquals("", $post->pinged); 
    2131         $this->assertEquals("2007-09-04 09:39:23", $post->post_modified); 
    2132         $this->assertEquals("2007-09-03 23:39:23", $post->post_modified_gmt); 
    2133         $this->assertEquals("", $post->post_content_filtered); 
    2134         $this->assertEquals("0", $post->post_parent); 
    2135         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/14/", $post->guid); 
    2136         $this->assertEquals("0", $post->menu_order); 
    2137         $this->assertEquals("post", $post->post_type); 
    2138         $this->assertEquals("", $post->post_mime_type); 
    2139         $this->assertEquals("0", $post->comment_count); 
    2140         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2141         $this->assertEquals(1, count($cats)); 
    2142         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2143         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2144         $tags = wp_get_post_tags($post->ID); 
    2145         $this->assertEquals(0, count($tags)); 
    2146         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2147         $this->assertEquals(0, count($comments)); 
    2148  
    2149  
    2150         $post = $this->posts[44]; 
    2151         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2152         $this->assertEquals("2007-09-04 09:38:54", $post->post_date); 
    2153         $this->assertEquals("2007-09-03 23:38:54", $post->post_date_gmt); 
    2154         $this->assertEquals("Here's the body.  There's an optional excerpt too.", $post->post_content); 
    2155         $this->assertEquals("Protected: Test with secret password and excerpt", $post->post_title); 
    2156         $this->assertEquals("0", $post->post_category); 
    2157         $this->assertEquals("", $post->post_excerpt); 
    2158         $this->assertEquals("publish", $post->post_status); 
    2159         $this->assertEquals("open", $post->comment_status); 
    2160         $this->assertEquals("open", $post->ping_status); 
    2161         $this->assertEquals("", $post->post_password); 
    2162         $this->assertEquals("test-with-secret-password-and-excerpt", $post->post_name); 
    2163         $this->assertEquals("", $post->to_ping); 
    2164         $this->assertEquals("", $post->pinged); 
    2165         $this->assertEquals("2007-09-04 09:38:54", $post->post_modified); 
    2166         $this->assertEquals("2007-09-03 23:38:54", $post->post_modified_gmt); 
    2167         $this->assertEquals("", $post->post_content_filtered); 
    2168         $this->assertEquals("0", $post->post_parent); 
    2169         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-secret-password-and-excerpt/", $post->guid); 
    2170         $this->assertEquals("0", $post->menu_order); 
    2171         $this->assertEquals("post", $post->post_type); 
    2172         $this->assertEquals("", $post->post_mime_type); 
    2173         $this->assertEquals("0", $post->comment_count); 
    2174         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2175         $this->assertEquals(1, count($cats)); 
    2176         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2177         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2178         $tags = wp_get_post_tags($post->ID); 
    2179         $this->assertEquals(0, count($tags)); 
    2180         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2181         $this->assertEquals(0, count($comments)); 
    2182  
    2183  
    2184         $post = $this->posts[45]; 
    2185         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2186         $this->assertEquals("2007-09-04 09:38:05", $post->post_date); 
    2187         $this->assertEquals("2007-09-03 23:38:05", $post->post_date_gmt); 
    2188         $this->assertEquals("The password is secret.", $post->post_content); 
    2189         $this->assertEquals("Protected: Test with secret password", $post->post_title); 
    2190         $this->assertEquals("0", $post->post_category); 
    2191         $this->assertEquals("", $post->post_excerpt); 
    2192         $this->assertEquals("publish", $post->post_status); 
    2193         $this->assertEquals("open", $post->comment_status); 
    2194         $this->assertEquals("open", $post->ping_status); 
    2195         $this->assertEquals("", $post->post_password); 
    2196         $this->assertEquals("test-with-secret-password", $post->post_name); 
    2197         $this->assertEquals("", $post->to_ping); 
    2198         $this->assertEquals("", $post->pinged); 
    2199         $this->assertEquals("2007-09-04 09:38:05", $post->post_modified); 
    2200         $this->assertEquals("2007-09-03 23:38:05", $post->post_modified_gmt); 
    2201         $this->assertEquals("", $post->post_content_filtered); 
    2202         $this->assertEquals("0", $post->post_parent); 
    2203         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-secret-password/", $post->guid); 
    2204         $this->assertEquals("0", $post->menu_order); 
    2205         $this->assertEquals("post", $post->post_type); 
    2206         $this->assertEquals("", $post->post_mime_type); 
    2207         $this->assertEquals("0", $post->comment_count); 
    2208         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2209         $this->assertEquals(1, count($cats)); 
    2210         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2211         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2212         $tags = wp_get_post_tags($post->ID); 
    2213         $this->assertEquals(0, count($tags)); 
    2214         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2215         $this->assertEquals(0, count($comments)); 
    2216  
    2217  
    2218         $post = $this->posts[46]; 
    2219         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2220         $this->assertEquals("2007-09-04 09:37:59", $post->post_date); 
    2221         $this->assertEquals("2007-09-03 23:37:59", $post->post_date_gmt); 
    2222         $this->assertEquals("Align right:\n\n<img SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg\" ALT=\"2007-06-30-dsc_4711-300px.jpg\" ALIGN=\"right\" />\n\nAlign left:\n\n<img SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg\" ALT=\"2007-06-30-dsc_4711-300px.jpg\" />", $post->post_content); 
    2223         $this->assertEquals("Image align test", $post->post_title); 
    2224         $this->assertEquals("0", $post->post_category); 
    2225         $this->assertEquals("", $post->post_excerpt); 
    2226         $this->assertEquals("publish", $post->post_status); 
    2227         $this->assertEquals("open", $post->comment_status); 
    2228         $this->assertEquals("open", $post->ping_status); 
    2229         $this->assertEquals("", $post->post_password); 
    2230         $this->assertEquals("image-align-test", $post->post_name); 
    2231         $this->assertEquals("", $post->to_ping); 
    2232         $this->assertEquals("", $post->pinged); 
    2233         $this->assertEquals("2007-09-04 09:37:59", $post->post_modified); 
    2234         $this->assertEquals("2007-09-03 23:37:59", $post->post_modified_gmt); 
    2235         $this->assertEquals("", $post->post_content_filtered); 
    2236         $this->assertEquals("0", $post->post_parent); 
    2237         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/image-align-test/", $post->guid); 
    2238         $this->assertEquals("0", $post->menu_order); 
    2239         $this->assertEquals("post", $post->post_type); 
    2240         $this->assertEquals("", $post->post_mime_type); 
    2241         $this->assertEquals("0", $post->comment_count); 
    2242         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2243         $this->assertEquals(1, count($cats)); 
    2244         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2245         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2246         $tags = wp_get_post_tags($post->ID); 
    2247         $this->assertEquals(0, count($tags)); 
    2248         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2249         $this->assertEquals(0, count($comments)); 
    2250  
    2251  
    2252         $post = $this->posts[47]; 
    2253         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2254         $this->assertEquals("2007-09-04 09:36:28", $post->post_date); 
    2255         $this->assertEquals("2007-09-03 23:36:28", $post->post_date_gmt); 
    2256         $this->assertEquals("Three thumbs with links:\n\n<a TITLE=\"2007-06-30-dsc_4700-1.jpg\" HREF=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg\"><img ALT=\"2007-06-30-dsc_4700-1.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1-150x150.jpg\" /></a><a TITLE=\"2007-06-30-dsc_4711-900px.jpg\" HREF=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg\"><img ALT=\"2007-06-30-dsc_4711-900px.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px-150x150.jpg\" /></a><a TITLE=\"2007-06-30-dsc_4711-300px.jpg\" HREF=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg\"><img ALT=\"2007-06-30-dsc_4711-300px.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px-150x150.jpg\" /></a>", $post->post_content); 
    2257         $this->assertEquals("Test with thumbnails", $post->post_title); 
    2258         $this->assertEquals("0", $post->post_category); 
    2259         $this->assertEquals("", $post->post_excerpt); 
    2260         $this->assertEquals("publish", $post->post_status); 
    2261         $this->assertEquals("open", $post->comment_status); 
    2262         $this->assertEquals("open", $post->ping_status); 
    2263         $this->assertEquals("", $post->post_password); 
    2264         $this->assertEquals("test-with-thumbnails", $post->post_name); 
    2265         $this->assertEquals("", $post->to_ping); 
    2266         $this->assertEquals("", $post->pinged); 
    2267         $this->assertEquals("2007-09-04 09:36:28", $post->post_modified); 
    2268         $this->assertEquals("2007-09-03 23:36:28", $post->post_modified_gmt); 
    2269         $this->assertEquals("", $post->post_content_filtered); 
    2270         $this->assertEquals("0", $post->post_parent); 
    2271         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-thumbnails/", $post->guid); 
    2272         $this->assertEquals("0", $post->menu_order); 
    2273         $this->assertEquals("post", $post->post_type); 
    2274         $this->assertEquals("", $post->post_mime_type); 
    2275         $this->assertEquals("0", $post->comment_count); 
    2276         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2277         $this->assertEquals(1, count($cats)); 
    2278         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2279         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2280         $tags = wp_get_post_tags($post->ID); 
    2281         $this->assertEquals(0, count($tags)); 
    2282         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2283         $this->assertEquals(0, count($comments)); 
    2284  
    2285  
    2286         $post = $this->posts[48]; 
    2287         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2288         $this->assertEquals("2007-09-04 09:35:23", $post->post_date); 
    2289         $this->assertEquals("2007-09-03 23:35:23", $post->post_date_gmt); 
    2290         $this->assertEquals("Image is 900x598px, resized in editor to 329x222.\n\n<a href=\"http://asdftestblog1.wordpress.com/2007/09/04/test-with-wide-image/9/\" title=\"2007-06-30-dsc_4711-900px.jpg\" rel=\"attachment wp-att-9\"><img src=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg\" alt=\"2007-06-30-dsc_4711-900px.jpg\" height=\"222\" width=\"329\" /></a>", $post->post_content); 
    2291         $this->assertEquals("Test with wide image resized", $post->post_title); 
    2292         $this->assertEquals("0", $post->post_category); 
    2293         $this->assertEquals("", $post->post_excerpt); 
    2294         $this->assertEquals("publish", $post->post_status); 
    2295         $this->assertEquals("open", $post->comment_status); 
    2296         $this->assertEquals("open", $post->ping_status); 
    2297         $this->assertEquals("", $post->post_password); 
    2298         $this->assertEquals("test-with-wide-image-resized", $post->post_name); 
    2299         $this->assertEquals("", $post->to_ping); 
    2300         $this->assertEquals("", $post->pinged); 
    2301         $this->assertEquals("2007-09-04 09:35:23", $post->post_modified); 
    2302         $this->assertEquals("2007-09-03 23:35:23", $post->post_modified_gmt); 
    2303         $this->assertEquals("", $post->post_content_filtered); 
    2304         $this->assertEquals("0", $post->post_parent); 
    2305         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-wide-image-resized/", $post->guid); 
    2306         $this->assertEquals("0", $post->menu_order); 
    2307         $this->assertEquals("post", $post->post_type); 
    2308         $this->assertEquals("", $post->post_mime_type); 
    2309         $this->assertEquals("0", $post->comment_count); 
    2310         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2311         $this->assertEquals(1, count($cats)); 
    2312         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2313         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2314         $tags = wp_get_post_tags($post->ID); 
    2315         $this->assertEquals(0, count($tags)); 
    2316         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2317         $this->assertEquals(0, count($comments)); 
    2318  
    2319  
    2320         $post = $this->posts[49]; 
    2321         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2322         $this->assertEquals("2007-09-04 09:31:31", $post->post_date); 
    2323         $this->assertEquals("2007-09-03 23:31:31", $post->post_date_gmt); 
    2324         $this->assertEquals("Image is 900x598px, not resized in editor.\n\n<a TITLE=\"2007-06-30-dsc_4711-900px.jpg\" REL=\"attachment wp-att-9\" HREF=\"http://asdftestblog1.wordpress.com/?attachment_id=9\"><img ALT=\"2007-06-30-dsc_4711-900px.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg\" /></a>", $post->post_content); 
    2325         $this->assertEquals("Test with wide image", $post->post_title); 
    2326         $this->assertEquals("0", $post->post_category); 
    2327         $this->assertEquals("", $post->post_excerpt); 
    2328         $this->assertEquals("publish", $post->post_status); 
    2329         $this->assertEquals("open", $post->comment_status); 
    2330         $this->assertEquals("open", $post->ping_status); 
    2331         $this->assertEquals("", $post->post_password); 
    2332         $this->assertEquals("test-with-wide-image", $post->post_name); 
    2333         $this->assertEquals("", $post->to_ping); 
    2334         $this->assertEquals("", $post->pinged); 
    2335         $this->assertEquals("2007-09-04 09:31:31", $post->post_modified); 
    2336         $this->assertEquals("2007-09-03 23:31:31", $post->post_modified_gmt); 
    2337         $this->assertEquals("", $post->post_content_filtered); 
    2338         $this->assertEquals("0", $post->post_parent); 
    2339         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-wide-image/", $post->guid); 
    2340         $this->assertEquals("0", $post->menu_order); 
    2341         $this->assertEquals("post", $post->post_type); 
    2342         $this->assertEquals("", $post->post_mime_type); 
    2343         $this->assertEquals("0", $post->comment_count); 
    2344         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2345         $this->assertEquals(1, count($cats)); 
    2346         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2347         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2348         $tags = wp_get_post_tags($post->ID); 
    2349         $this->assertEquals(0, count($tags)); 
    2350         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2351         $this->assertEquals(0, count($comments)); 
    2352  
    2353  
    2354         $post = $this->posts[50]; 
    2355         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2356         $this->assertEquals("2007-09-04 09:31:12", $post->post_date); 
    2357         $this->assertEquals("2007-09-03 23:31:12", $post->post_date_gmt); 
    2358         $this->assertEquals("", $post->post_content); 
    2359         $this->assertEquals("", $post->post_title); 
    2360         $this->assertEquals("0", $post->post_category); 
    2361         $this->assertEquals("", $post->post_excerpt); 
    2362         $this->assertEquals("inherit", $post->post_status); 
    2363         $this->assertEquals("open", $post->comment_status); 
    2364         $this->assertEquals("open", $post->ping_status); 
    2365         $this->assertEquals("", $post->post_password); 
    2366         $this->assertEquals("9", $post->post_name); 
    2367         $this->assertEquals("", $post->to_ping); 
    2368         $this->assertEquals("", $post->pinged); 
    2369         $this->assertEquals("2007-09-04 09:31:12", $post->post_modified); 
    2370         $this->assertEquals("2007-09-03 23:31:12", $post->post_modified_gmt); 
    2371         $this->assertEquals("", $post->post_content_filtered); 
    2372         $this->assertEquals($this->posts[49]->ID, $post->post_parent); 
    2373         $this->assertEquals(wp_get_attachment_url($post->ID), $post->guid); 
    2374         $this->assertEquals("0", $post->menu_order); 
    2375         $this->assertEquals("attachment", $post->post_type); 
    2376         $this->assertEquals("image/jpeg", $post->post_mime_type); 
    2377         $this->assertEquals("0", $post->comment_count); 
    2378         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2379         $this->assertEquals(1, count($cats)); 
    2380         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2381         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2382         $tags = wp_get_post_tags($post->ID); 
    2383         $this->assertEquals(0, count($tags)); 
    2384         $this->assertEquals(array ( 
    2385   0 => '/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4711-900px.jpg', 
    2386   1 => '/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg', 
    2387 ), get_post_meta($post->ID, '_wp_attached_file', false)); 
    2388         $this->assertEquals(array ( 
    2389   0 => 's:590:"a:6:{s:5:"width";i:900;s:6:"height";i:598;s:14:"hwstring_small";s:23:"height=\'85\' width=\'128\'";s:4:"file";s:100:"/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4711-900px.jpg";s:5:"thumb";s:39:"2007-06-30-dsc_4711-900px.thumbnail.jpg";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183237219;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.0013333333333333332593184650249895639717578887939453125;s:5:"title";s:0:"";}}";', 
    2390   1 => 'a:6:{s:5:"width";i:900;s:6:"height";i:598;s:14:"hwstring_small";s:23:"height=\'85\' width=\'128\'";s:4:"file";s:108:"/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4711-900px.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:37:"2007-06-30-dsc_4711-900px-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:6:"medium";a:3:{s:4:"file";s:37:"2007-06-30-dsc_4711-900px-300x199.jpg";s:5:"width";i:300;s:6:"height";i:199;}}s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183201219;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.00133333333333333328880876411659528457676060497760772705078125;s:5:"title";s:0:"";}}', 
    2391 ), get_post_meta($post->ID, '_wp_attachment_metadata', false)); 
    2392         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2393         $this->assertEquals(0, count($comments)); 
    2394  
    2395  
    2396         $post = $this->posts[51]; 
    2397         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2398         $this->assertEquals("2007-09-04 09:30:02", $post->post_date); 
    2399         $this->assertEquals("2007-09-03 23:30:02", $post->post_date_gmt); 
    2400         $this->assertEquals("Image is 300x199, not resized in editor.\n\n<a TITLE=\"2007-06-30-dsc_4711-300px.jpg\" REL=\"attachment wp-att-7\" HREF=\"http://asdftestblog1.wordpress.com/?attachment_id=7\"><img ALT=\"2007-06-30-dsc_4711-300px.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg\" /></a>", $post->post_content); 
    2401         $this->assertEquals("Test with image", $post->post_title); 
    2402         $this->assertEquals("0", $post->post_category); 
    2403         $this->assertEquals("", $post->post_excerpt); 
    2404         $this->assertEquals("publish", $post->post_status); 
    2405         $this->assertEquals("open", $post->comment_status); 
    2406         $this->assertEquals("open", $post->ping_status); 
    2407         $this->assertEquals("", $post->post_password); 
    2408         $this->assertEquals("test-with-image", $post->post_name); 
    2409         $this->assertEquals("", $post->to_ping); 
    2410         $this->assertEquals("", $post->pinged); 
    2411         $this->assertEquals("2007-09-04 09:30:02", $post->post_modified); 
    2412         $this->assertEquals("2007-09-03 23:30:02", $post->post_modified_gmt); 
    2413         $this->assertEquals("", $post->post_content_filtered); 
    2414         $this->assertEquals("0", $post->post_parent); 
    2415         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/test-with-image/", $post->guid); 
    2416         $this->assertEquals("0", $post->menu_order); 
    2417         $this->assertEquals("post", $post->post_type); 
    2418         $this->assertEquals("", $post->post_mime_type); 
    2419         $this->assertEquals("0", $post->comment_count); 
    2420         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2421         $this->assertEquals(1, count($cats)); 
    2422         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2423         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2424         $tags = wp_get_post_tags($post->ID); 
    2425         $this->assertEquals(0, count($tags)); 
    2426         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2427         $this->assertEquals(0, count($comments)); 
    2428  
    2429  
    2430         $post = $this->posts[52]; 
    2431         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2432         $this->assertEquals("2007-09-04 09:29:34", $post->post_date); 
    2433         $this->assertEquals("2007-09-03 23:29:34", $post->post_date_gmt); 
    2434         $this->assertEquals("", $post->post_content); 
    2435         $this->assertEquals("", $post->post_title); 
    2436         $this->assertEquals("0", $post->post_category); 
    2437         $this->assertEquals("", $post->post_excerpt); 
    2438         $this->assertEquals("inherit", $post->post_status); 
    2439         $this->assertEquals("open", $post->comment_status); 
    2440         $this->assertEquals("open", $post->ping_status); 
    2441         $this->assertEquals("", $post->post_password); 
    2442         $this->assertEquals("7", $post->post_name); 
    2443         $this->assertEquals("", $post->to_ping); 
    2444         $this->assertEquals("", $post->pinged); 
    2445         $this->assertEquals("2007-09-04 09:29:34", $post->post_modified); 
    2446         $this->assertEquals("2007-09-03 23:29:34", $post->post_modified_gmt); 
    2447         $this->assertEquals("", $post->post_content_filtered); 
    2448         $this->assertEquals($this->posts[51]->ID, $post->post_parent); 
    2449         $this->assertEquals(wp_get_attachment_url($post->ID), $post->guid); 
    2450         $this->assertEquals("0", $post->menu_order); 
    2451         $this->assertEquals("attachment", $post->post_type); 
    2452         $this->assertEquals("image/jpeg", $post->post_mime_type); 
    2453         $this->assertEquals("0", $post->comment_count); 
    2454         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2455         $this->assertEquals(1, count($cats)); 
    2456         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2457         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2458         $tags = wp_get_post_tags($post->ID); 
    2459         $this->assertEquals(0, count($tags)); 
    2460         $this->assertEquals(array ( 
    2461   0 => '/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4711-300px.jpg', 
    2462   1 => '/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg', 
    2463 ), get_post_meta($post->ID, '_wp_attached_file', false)); 
    2464         $this->assertEquals(array ( 
    2465   0 => 's:590:"a:6:{s:5:"width";i:300;s:6:"height";i:199;s:14:"hwstring_small";s:23:"height=\'84\' width=\'128\'";s:4:"file";s:100:"/home/wpcom/public_html/wp-content/blogs.dir/8de/1641616/files/2007/09/2007-06-30-dsc_4711-300px.jpg";s:5:"thumb";s:39:"2007-06-30-dsc_4711-300px.thumbnail.jpg";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183237219;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.0013333333333333332593184650249895639717578887939453125;s:5:"title";s:0:"";}}";', 
    2466   1 => 'a:6:{s:5:"width";i:300;s:6:"height";i:199;s:14:"hwstring_small";s:23:"height=\'84\' width=\'128\'";s:4:"file";s:108:"/Users/alex/Documents/dev/wordpress-tests/wordpress/wp-content/uploads/2007/09/2007-06-30-dsc_4711-300px.jpg";s:5:"sizes";a:1:{s:9:"thumbnail";a:3:{s:4:"file";s:37:"2007-06-30-dsc_4711-300px-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}}s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:9:"NIKON D70";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1183201219;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:200;s:13:"shutter_speed";d:0.00133333333333333328880876411659528457676060497760772705078125;s:5:"title";s:0:"";}}', 
    2467 ), get_post_meta($post->ID, '_wp_attachment_metadata', false)); 
    2468         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2469         $this->assertEquals(0, count($comments)); 
    2470  
    2471  
    2472         $post = $this->posts[53]; 
    2473         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2474         $this->assertEquals("2007-09-04 09:22:14", $post->post_date); 
    2475         $this->assertEquals("2007-09-03 23:22:14", $post->post_date_gmt); 
    2476         $this->assertEquals("Parent, Child 1 and Child2.", $post->post_content); 
    2477         $this->assertEquals("Post with categories", $post->post_title); 
    2478         $this->assertEquals("0", $post->post_category); 
    2479         $this->assertEquals("", $post->post_excerpt); 
    2480         $this->assertEquals("publish", $post->post_status); 
    2481         $this->assertEquals("open", $post->comment_status); 
    2482         $this->assertEquals("open", $post->ping_status); 
    2483         $this->assertEquals("", $post->post_password); 
    2484         $this->assertEquals("post-with-categories", $post->post_name); 
    2485         $this->assertEquals("", $post->to_ping); 
    2486         $this->assertEquals("", $post->pinged); 
    2487         $this->assertEquals("2007-09-04 09:22:14", $post->post_modified); 
    2488         $this->assertEquals("2007-09-03 23:22:14", $post->post_modified_gmt); 
    2489         $this->assertEquals("", $post->post_content_filtered); 
    2490         $this->assertEquals("0", $post->post_parent); 
    2491         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/post-with-categories/", $post->guid); 
    2492         $this->assertEquals("0", $post->menu_order); 
    2493         $this->assertEquals("post", $post->post_type); 
    2494         $this->assertEquals("", $post->post_mime_type); 
    2495         $this->assertEquals("0", $post->comment_count); 
    2496         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2497         $this->assertEquals(3, count($cats)); 
    2498         $this->assertEquals('Child 1', $cats[0]->name); 
    2499         $this->assertEquals('child-1', $cats[0]->slug); 
    2500         $this->assertEquals('Child 2', $cats[1]->name); 
    2501         $this->assertEquals('child-2', $cats[1]->slug); 
    2502         $this->assertEquals('Parent', $cats[2]->name); 
    2503         $this->assertEquals('parent', $cats[2]->slug); 
    2504         $tags = wp_get_post_tags($post->ID); 
    2505         $this->assertEquals(0, count($tags)); 
    2506         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2507         $this->assertEquals(0, count($comments)); 
    2508  
    2509  
    2510         $post = $this->posts[54]; 
    2511         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2512         $this->assertEquals("2007-09-04 09:18:44", $post->post_date); 
    2513         $this->assertEquals("2007-09-03 23:18:44", $post->post_date_gmt); 
    2514         $this->assertEquals("Timezone offset is +10, timestamp is 04 Sep 2007 @ 9:18am", $post->post_content); 
    2515         $this->assertEquals("GMT+10 test post", $post->post_title); 
    2516         $this->assertEquals("0", $post->post_category); 
    2517         $this->assertEquals("", $post->post_excerpt); 
    2518         $this->assertEquals("publish", $post->post_status); 
    2519         $this->assertEquals("open", $post->comment_status); 
    2520         $this->assertEquals("open", $post->ping_status); 
    2521         $this->assertEquals("", $post->post_password); 
    2522         $this->assertEquals("gmt10-test-post", $post->post_name); 
    2523         $this->assertEquals("", $post->to_ping); 
    2524         $this->assertEquals("", $post->pinged); 
    2525         $this->assertEquals("2007-09-04 09:18:44", $post->post_modified); 
    2526         $this->assertEquals("2007-09-03 23:18:44", $post->post_modified_gmt); 
    2527         $this->assertEquals("", $post->post_content_filtered); 
    2528         $this->assertEquals("0", $post->post_parent); 
    2529         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/04/gmt10-test-post/", $post->guid); 
    2530         $this->assertEquals("0", $post->menu_order); 
    2531         $this->assertEquals("post", $post->post_type); 
    2532         $this->assertEquals("", $post->post_mime_type); 
    2533         $this->assertEquals("0", $post->comment_count); 
    2534         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2535         $this->assertEquals(1, count($cats)); 
    2536         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2537         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2538         $tags = wp_get_post_tags($post->ID); 
    2539         $this->assertEquals(0, count($tags)); 
    2540         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2541         $this->assertEquals(0, count($comments)); 
    2542  
    2543  
    2544         $post = $this->posts[55]; 
    2545         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2546         $this->assertEquals("2007-09-03 23:15:10", $post->post_date); 
    2547         $this->assertEquals("2007-09-03 23:15:10", $post->post_date_gmt); 
    2548         $this->assertEquals("TZ offset is 0, post time is 03 Sep 2007 @ 11.14pm.", $post->post_content); 
    2549         $this->assertEquals("GMT test post", $post->post_title); 
    2550         $this->assertEquals("0", $post->post_category); 
    2551         $this->assertEquals("", $post->post_excerpt); 
    2552         $this->assertEquals("publish", $post->post_status); 
    2553         $this->assertEquals("open", $post->comment_status); 
    2554         $this->assertEquals("open", $post->ping_status); 
    2555         $this->assertEquals("", $post->post_password); 
    2556         $this->assertEquals("gmt-test-post", $post->post_name); 
    2557         $this->assertEquals("", $post->to_ping); 
    2558         $this->assertEquals("", $post->pinged); 
    2559         $this->assertEquals("2007-09-03 23:15:10", $post->post_modified); 
    2560         $this->assertEquals("2007-09-03 23:15:10", $post->post_modified_gmt); 
    2561         $this->assertEquals("", $post->post_content_filtered); 
    2562         $this->assertEquals("0", $post->post_parent); 
    2563         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/03/gmt-test-post/", $post->guid); 
    2564         $this->assertEquals("0", $post->menu_order); 
    2565         $this->assertEquals("post", $post->post_type); 
    2566         $this->assertEquals("", $post->post_mime_type); 
    2567         $this->assertEquals("0", $post->comment_count); 
    2568         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2569         $this->assertEquals(1, count($cats)); 
    2570         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2571         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2572         $tags = wp_get_post_tags($post->ID); 
    2573         $this->assertEquals(0, count($tags)); 
    2574         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2575         $this->assertEquals(0, count($comments)); 
    2576  
    2577  
    2578         $post = $this->posts[56]; 
    2579         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2580         $this->assertEquals("2007-09-03 23:08:37", $post->post_date); 
    2581         $this->assertEquals("2007-09-03 23:08:37", $post->post_date_gmt); 
    2582         $this->assertEquals("This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.\n\nMinor edit.\n\nMinor edit 2.", $post->post_content); 
    2583         $this->assertEquals("About", $post->post_title); 
    2584         $this->assertEquals("0", $post->post_category); 
    2585         $this->assertEquals("", $post->post_excerpt); 
    2586         $this->assertEquals("publish", $post->post_status); 
    2587         $this->assertEquals("open", $post->comment_status); 
    2588         $this->assertEquals("open", $post->ping_status); 
    2589         $this->assertEquals("", $post->post_password); 
    2590         $this->assertEquals("about", $post->post_name); 
    2591         $this->assertEquals("", $post->to_ping); 
    2592         $this->assertEquals("", $post->pinged); 
    2593         $this->assertEquals("2007-09-03 23:08:37", $post->post_modified); 
    2594         $this->assertEquals("2007-09-03 23:08:37", $post->post_modified_gmt); 
    2595         $this->assertEquals("", $post->post_content_filtered); 
    2596         $this->assertEquals("0", $post->post_parent); 
    2597         $this->assertEquals("http://example.com/?page_id={$post->ID}", $post->guid); 
    2598         $this->assertEquals("0", $post->menu_order); 
    2599         $this->assertEquals("page", $post->post_type); 
    2600         $this->assertEquals("", $post->post_mime_type); 
    2601         $this->assertEquals("0", $post->comment_count); 
    2602         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2603         $this->assertEquals(1, count($cats)); 
    2604         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2605         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2606         $tags = wp_get_post_tags($post->ID); 
    2607         $this->assertEquals(0, count($tags)); 
    2608         $this->assertEquals(array ( 
    2609   0 => 'default', 
    2610 ), get_post_meta($post->ID, '_wp_page_template', false)); 
    2611         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2612         $this->assertEquals(0, count($comments)); 
    2613  
    2614  
    2615         $post = $this->posts[57]; 
    2616         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2617         $this->assertEquals("2007-09-03 23:08:37", $post->post_date); 
    2618         $this->assertEquals("2007-09-03 23:08:37", $post->post_date_gmt); 
    2619         $this->assertEquals("Welcome to <a href=\"http://wordpress.com/\">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!", $post->post_content); 
    2620         $this->assertEquals("Hello world!", $post->post_title); 
    2621         $this->assertEquals("0", $post->post_category); 
    2622         $this->assertEquals("", $post->post_excerpt); 
    2623         $this->assertEquals("publish", $post->post_status); 
    2624         $this->assertEquals("open", $post->comment_status); 
    2625         $this->assertEquals("open", $post->ping_status); 
    2626         $this->assertEquals("", $post->post_password); 
    2627         $this->assertEquals("hello-world", $post->post_name); 
    2628         $this->assertEquals("", $post->to_ping); 
    2629         $this->assertEquals("", $post->pinged); 
    2630         $this->assertEquals("2007-09-03 23:08:37", $post->post_modified); 
    2631         $this->assertEquals("2007-09-03 23:08:37", $post->post_modified_gmt); 
    2632         $this->assertEquals("", $post->post_content_filtered); 
    2633         $this->assertEquals("0", $post->post_parent); 
    2634         $this->assertEquals("http://example.com/?p={$post->ID}", $post->guid); 
    2635         $this->assertEquals("0", $post->menu_order); 
    2636         $this->assertEquals("post", $post->post_type); 
    2637         $this->assertEquals("", $post->post_mime_type); 
    2638         $this->assertEquals("1", $post->comment_count); 
    2639         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2640         $this->assertEquals(1, count($cats)); 
    2641         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2642         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2643         $tags = wp_get_post_tags($post->ID); 
    2644         $this->assertEquals(0, count($tags)); 
    2645         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2646         $this->assertEquals(1, count($comments)); 
    2647         $this->assertEquals('Mr WordPress', $comments[0]->comment_author); 
    2648         $this->assertEquals('', $comments[0]->comment_author_email); 
    2649         $this->assertEquals('http://wordpress.com/', $comments[0]->comment_author_url); 
    2650         $this->assertEquals('127.0.0.1', $comments[0]->comment_author_IP); 
    2651         $this->assertEquals('2007-09-03 23:08:37', $comments[0]->comment_date); 
    2652         $this->assertEquals('2007-09-03 23:08:37', $comments[0]->comment_date_gmt); 
    2653         $this->assertEquals('0', $comments[0]->comment_karma); 
    2654         $this->assertEquals('1', $comments[0]->comment_approved); 
    2655         $this->assertEquals('', $comments[0]->comment_agent); 
    2656         $this->assertEquals('', $comments[0]->comment_type); 
    2657         $this->assertEquals('0', $comments[0]->comment_parent); 
    2658         $this->assertEquals('', $comments[0]->comment_user_id); 
    2659  
    2660  
    2661         $post = $this->posts[58]; 
    2662         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2663         $this->assertEquals("2007-09-03 17:17:01", $post->post_date); 
    2664         $this->assertEquals("2007-09-03 23:17:01", $post->post_date_gmt); 
    2665         $this->assertEquals("Timezone offset is -6, time is 03 Sep 2007 @ 5.16pm", $post->post_content); 
    2666         $this->assertEquals("GMT-6 test post", $post->post_title); 
    2667         $this->assertEquals("0", $post->post_category); 
    2668         $this->assertEquals("", $post->post_excerpt); 
    2669         $this->assertEquals("publish", $post->post_status); 
    2670         $this->assertEquals("open", $post->comment_status); 
    2671         $this->assertEquals("open", $post->ping_status); 
    2672         $this->assertEquals("", $post->post_password); 
    2673         $this->assertEquals("gmt-6-test-post", $post->post_name); 
    2674         $this->assertEquals("", $post->to_ping); 
    2675         $this->assertEquals("", $post->pinged); 
    2676         $this->assertEquals("2007-09-03 17:17:01", $post->post_modified); 
    2677         $this->assertEquals("2007-09-03 23:17:01", $post->post_modified_gmt); 
    2678         $this->assertEquals("", $post->post_content_filtered); 
    2679         $this->assertEquals("0", $post->post_parent); 
    2680         $this->assertEquals("http://asdftestblog1.wordpress.com/2007/09/03/gmt-6-test-post/", $post->guid); 
    2681         $this->assertEquals("0", $post->menu_order); 
    2682         $this->assertEquals("post", $post->post_type); 
    2683         $this->assertEquals("", $post->post_mime_type); 
    2684         $this->assertEquals("0", $post->comment_count); 
    2685         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2686         $this->assertEquals(1, count($cats)); 
    2687         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2688         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2689         $tags = wp_get_post_tags($post->ID); 
    2690         $this->assertEquals(0, count($tags)); 
    2691         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2692         $this->assertEquals(0, count($comments)); 
    2693  
    2694  
    2695         $post = $this->posts[59]; 
    2696         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2697         $this->assertEquals("1982-01-01 11:11:15", $post->post_date); 
    2698         $this->assertEquals("1982-01-01 01:11:15", $post->post_date_gmt); 
    2699         $this->assertEquals("", $post->post_content); 
    2700         $this->assertEquals("Article in the distant past", $post->post_title); 
    2701         $this->assertEquals("0", $post->post_category); 
    2702         $this->assertEquals("", $post->post_excerpt); 
    2703         $this->assertEquals("publish", $post->post_status); 
    2704         $this->assertEquals("open", $post->comment_status); 
    2705         $this->assertEquals("open", $post->ping_status); 
    2706         $this->assertEquals("", $post->post_password); 
    2707         $this->assertEquals("article-in-the-distant-past", $post->post_name); 
    2708         $this->assertEquals("", $post->to_ping); 
    2709         $this->assertEquals("", $post->pinged); 
    2710         $this->assertEquals("1982-01-01 11:11:15", $post->post_modified); 
    2711         $this->assertEquals("1982-01-01 01:11:15", $post->post_modified_gmt); 
    2712         $this->assertEquals("", $post->post_content_filtered); 
    2713         $this->assertEquals("0", $post->post_parent); 
    2714         $this->assertEquals("http://asdftestblog1.wordpress.com/1982/01/01/article-in-the-distant-past/", $post->guid); 
    2715         $this->assertEquals("0", $post->menu_order); 
    2716         $this->assertEquals("post", $post->post_type); 
    2717         $this->assertEquals("", $post->post_mime_type); 
    2718         $this->assertEquals("0", $post->comment_count); 
    2719         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2720         $this->assertEquals(1, count($cats)); 
    2721         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2722         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2723         $tags = wp_get_post_tags($post->ID); 
    2724         $this->assertEquals(0, count($tags)); 
    2725         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2726         $this->assertEquals(0, count($comments)); 
    2727  
    2728  
    2729         $post = $this->posts[60]; 
    2730         $this->assertEquals(get_profile('ID', 'User B'), $post->post_author); 
    2731         $this->assertEquals("0000-00-00 00:00:00", $post->post_date); 
    2732         $this->assertEquals("0000-00-00 00:00:00", $post->post_date_gmt); 
    2733         $this->assertEquals("This post is awaiting review.", $post->post_content); 
    2734         $this->assertEquals("Contributor post, pending approval", $post->post_title); 
    2735         $this->assertEquals("0", $post->post_category); 
    2736         $this->assertEquals("", $post->post_excerpt); 
    2737         $this->assertEquals("pending", $post->post_status); 
    2738         $this->assertEquals("open", $post->comment_status); 
    2739         $this->assertEquals("open", $post->ping_status); 
    2740         $this->assertEquals("", $post->post_password); 
    2741         $this->assertEquals("contributor-post-pending-approval", $post->post_name); 
    2742         $this->assertEquals("", $post->to_ping); 
    2743         $this->assertEquals("", $post->pinged); 
    2744 #       $this->assertEquals("2008-01-30 16:35:51", $post->post_modified); 
    2745 #       $this->assertEquals("2008-01-30 05:35:51", $post->post_modified_gmt); 
    2746         $this->assertEquals("", $post->post_content_filtered); 
    2747         $this->assertEquals("0", $post->post_parent); 
    2748         $this->assertEquals("http://asdftestblog1.wordpress.com/?p=36", $post->guid); 
    2749         $this->assertEquals("0", $post->menu_order); 
    2750         $this->assertEquals("post", $post->post_type); 
    2751         $this->assertEquals("", $post->post_mime_type); 
    2752         $this->assertEquals("0", $post->comment_count); 
    2753         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2754         $this->assertEquals(1, count($cats)); 
    2755         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2756         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2757         $tags = wp_get_post_tags($post->ID); 
    2758         $this->assertEquals(0, count($tags)); 
    2759         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2760         $this->assertEquals(0, count($comments)); 
    2761  
    2762  
    2763         $post = $this->posts[61]; 
    2764         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2765         $this->assertEquals("0000-00-00 00:00:00", $post->post_date); 
    2766         $this->assertEquals("0000-00-00 00:00:00", $post->post_date_gmt); 
    2767         $this->assertEquals("Image file attached, 300px high.\n\n<a TITLE=\"2007-06-30-dsc_4700-1.jpg\" REL=\"attachment wp-att-25\" HREF=\"http://asdftestblog1.wordpress.com/?attachment_id=25\"><img ALT=\"2007-06-30-dsc_4700-1.jpg\" SRC=\"http://example.com/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg\" /></a>", $post->post_content); 
    2768         $this->assertEquals("Draft post with file attached", $post->post_title); 
    2769         $this->assertEquals("0", $post->post_category); 
    2770         $this->assertEquals("", $post->post_excerpt); 
    2771         $this->assertEquals("draft", $post->post_status); 
    2772         $this->assertEquals("open", $post->comment_status); 
    2773         $this->assertEquals("open", $post->ping_status); 
    2774         $this->assertEquals("", $post->post_password); 
    2775         $this->assertEquals("", $post->post_name); 
    2776         $this->assertEquals("", $post->to_ping); 
    2777         $this->assertEquals("", $post->pinged); 
    2778 #       $this->assertEquals("2008-01-30 16:35:51", $post->post_modified); 
    2779 #       $this->assertEquals("2008-01-30 05:35:51", $post->post_modified_gmt); 
    2780         $this->assertEquals("", $post->post_content_filtered); 
    2781         $this->assertEquals("0", $post->post_parent); 
    2782         $this->assertEquals("http://asdftestblog1.wordpress.com/?p=24", $post->guid); 
    2783         $this->assertEquals("0", $post->menu_order); 
    2784         $this->assertEquals("post", $post->post_type); 
    2785         $this->assertEquals("", $post->post_mime_type); 
    2786         $this->assertEquals("0", $post->comment_count); 
    2787         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2788         $this->assertEquals(1, count($cats)); 
    2789         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2790         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2791         $tags = wp_get_post_tags($post->ID); 
    2792         $this->assertEquals(0, count($tags)); 
    2793         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2794         $this->assertEquals(0, count($comments)); 
    2795  
    2796  
    2797         $post = $this->posts[62]; 
    2798         $this->assertEquals(get_profile('ID', 'User A'), $post->post_author); 
    2799         $this->assertEquals("0000-00-00 00:00:00", $post->post_date); 
    2800         $this->assertEquals("0000-00-00 00:00:00", $post->post_date_gmt); 
    2801         $this->assertEquals("Just a draft post.", $post->post_content); 
    2802         $this->assertEquals("Draft post", $post->post_title); 
    2803         $this->assertEquals("0", $post->post_category); 
    2804         $this->assertEquals("", $post->post_excerpt); 
    2805         $this->assertEquals("draft", $post->post_status); 
    2806         $this->assertEquals("open", $post->comment_status); 
    2807         $this->assertEquals("open", $post->ping_status); 
    2808         $this->assertEquals("", $post->post_password); 
    2809         $this->assertEquals("", $post->post_name); 
    2810         $this->assertEquals("", $post->to_ping); 
    2811         $this->assertEquals("", $post->pinged); 
    2812 #       $this->assertEquals("2008-01-30 16:35:51", $post->post_modified); 
    2813 #       $this->assertEquals("2008-01-30 05:35:51", $post->post_modified_gmt); 
    2814         $this->assertEquals("", $post->post_content_filtered); 
    2815         $this->assertEquals("0", $post->post_parent); 
    2816         $this->assertEquals("http://asdftestblog1.wordpress.com/?p=23", $post->guid); 
    2817         $this->assertEquals("0", $post->menu_order); 
    2818         $this->assertEquals("post", $post->post_type); 
    2819         $this->assertEquals("", $post->post_mime_type); 
    2820         $this->assertEquals("0", $post->comment_count); 
    2821         $cats = wp_get_post_categories($post->ID, array("fields"=>"all")); 
    2822         $this->assertEquals(1, count($cats)); 
    2823         $this->assertEquals('Uncategorized', $cats[0]->name); 
    2824         $this->assertEquals('uncategorized', $cats[0]->slug); 
    2825         $tags = wp_get_post_tags($post->ID); 
    2826         $this->assertEquals(0, count($tags)); 
    2827         $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID)); 
    2828         $this->assertEquals(0, count($comments)); 
    2829  
    2830     } 
    2831  
    2832  
     146     
     147    // tags in CDATA #11574 
    2833148} 
    2834149 
    2835 class TestImportWP_PostMeta extends _WPEmptyBlog { 
    2836  
    2837     var $posts = NULL; 
    2838  
     150class WPImportTest extends _WPEmptyBlog { 
    2839151    function setUp() { 
    2840152        parent::setUp(); 
    2841         include_once(ABSPATH.'/wp-admin/import/wordpress.php'); 
    2842         if ( !defined('WP_IMPORTING') ) 
    2843             define('WP_IMPORTING', true); 
     153 
     154        if ( ! defined( 'WP_IMPORTING' ) ) 
     155            define( 'WP_IMPORTING', true ); 
     156             
     157        if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 
     158            define( 'WP_LOAD_IMPORTERS', true ); 
     159             
     160        require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 
     161 
     162        global $wpdb; 
     163        // crude but effective: make sure there's no residual data in the main tables 
     164        foreach ( array('posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta') as $table) 
     165            $wpdb->query("DELETE FROM {$wpdb->$table}"); 
    2844166    } 
    2845167 
    2846168    function tearDown() { 
    2847169        parent::tearDown(); 
    2848         if ($user = get_user_by('login', 'User A')) 
    2849             wp_delete_user($user->ID); 
    2850     } 
    2851      
    2852     function test_serialized_postmeta_no_cdata() { 
    2853         $this->knownWPBug(10619); 
    2854         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/test-serialized-postmeta-no-cdata.xml', array('User A') ) ); 
    2855         $expected["special_post_title"] = "A special title"; 
    2856         $expected["is_calendar"]= ""; 
    2857         $this->assertEquals($expected, get_post_meta(122, 'post-options', true)); 
    2858     } 
    2859      
    2860     function test_utw_postmeta() { 
    2861         //test-utw-post-meta-import.xml 
    2862         $this->knownWPBug(12860); 
    2863         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/test-utw-post-meta-import.xml', array('User A') ) ); 
    2864  
    2865         $classy = new StdClass(); 
    2866         $classy->tag =  "album"; 
    2867         $expected[] = $classy; 
    2868         $classy = new StdClass(); 
    2869         $classy->tag =  "apple"; 
    2870         $expected[] = $classy; 
    2871         $classy = new StdClass(); 
    2872         $classy->tag =  "art"; 
    2873         $expected[] = $classy; 
    2874         $classy = new StdClass(); 
    2875         $classy->tag =  "artwork"; 
    2876         $expected[] = $classy;   
    2877         $classy = new StdClass(); 
    2878         $classy->tag =  "dead-tracks"; 
    2879         $expected[] = $classy;   
    2880         $classy = new StdClass(); 
    2881         $classy->tag =  "ipod"; 
    2882         $expected[] = $classy; 
    2883         $classy = new StdClass(); 
    2884         $classy->tag =  "itunes"; 
    2885         $expected[] = $classy; 
    2886         $classy = new StdClass(); 
    2887         $classy->tag =  "javascript"; 
    2888         $expected[] = $classy; 
    2889         $classy = new StdClass(); 
    2890         $classy->tag =  "lyrics"; 
    2891         $expected[] = $classy;   
    2892         $classy = new StdClass(); 
    2893         $classy->tag =  "script"; 
    2894         $expected[] = $classy;   
    2895         $classy = new StdClass(); 
    2896         $classy->tag =  "tracks"; 
    2897         $expected[] = $classy;   
    2898         $classy = new StdClass(); 
    2899         $classy->tag =  "windows-scripting-host"; 
    2900         $expected[] = $classy;   
    2901         $classy = new StdClass(); 
    2902         $classy->tag =  "wscript"; 
    2903         $expected[] = $classy;   
    2904          
    2905         $this->assertEquals($expected, get_post_meta(150, 'test', true)); 
    2906     } 
     170 
     171        $this->_delete_all_posts(); 
     172 
     173        if ( $user = get_user_by( 'login', 'admin' ) ) 
     174            wp_delete_user( $user->ID ); 
     175        if ( $user = get_user_by( 'login', 'editor' ) ) 
     176            wp_delete_user( $user->ID ); 
     177        if ( $user = get_user_by( 'login', 'author' ) ) 
     178            wp_delete_user( $user->ID ); 
     179    } 
     180     
     181    function test_small_import() { 
     182        global $wpdb; 
     183 
     184        $authors = array( 'admin' => true, 'editor' => true, 'author' => true );     
     185        $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors ); 
     186 
     187        // ensure that authors were imported correctly 
     188        $user_count = count_users(); 
     189        $this->assertEquals( 3, $user_count['total_users'] ); 
     190        $admin = get_user_by( 'login', 'admin' ); 
     191        $this->assertEquals( 'admin', $admin->user_login ); 
     192        $this->assertEquals( 'local@host.null', $admin->user_email ); 
     193        $editor = get_user_by( 'login', 'editor' ); 
     194        $this->assertEquals( 'editor', $editor->user_login ); 
     195        $this->assertEquals( 'editor@example.org', $editor->user_email ); 
     196        $this->assertEquals( 'FirstName', $editor->user_firstname ); 
     197        $this->assertEquals( 'LastName', $editor->user_lastname ); 
     198        $author = get_user_by( 'login', 'author' ); 
     199        $this->assertEquals( 'author', $author->user_login ); 
     200        $this->assertEquals( 'author@example.org', $author->user_email ); 
     201 
     202        // check that terms were imported correctly 
     203        $this->assertEquals( 30, wp_count_terms( 'category' ) ); 
     204        $this->assertEquals( 3, wp_count_terms( 'post_tag' ) ); 
     205        $foo = get_term_by( 'slug', 'foo', 'category' ); 
     206        $this->assertEquals( 0, $foo->parent ); 
     207        $bar = get_term_by( 'slug', 'bar', 'category' ); 
     208        $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' ); 
     209        $this->assertEquals( $bar->term_id, $foo_bar->parent ); 
     210 
     211        // check that posts/pages were imported correctly 
     212        $post_count = wp_count_posts( 'post' ); 
     213        $this->assertEquals( 5, $post_count->publish ); 
     214        $this->assertEquals( 1, $post_count->private ); 
     215        $page_count = wp_count_posts( 'page' ); 
     216        $this->assertEquals( 4, $page_count->publish ); 
     217        $this->assertEquals( 1, $page_count->draft ); 
     218        $comment_count = wp_count_comments(); 
     219        $this->assertEquals( 1, $comment_count->total_comments ); 
     220 
     221        $posts = get_posts( array( 'numberposts' => 20, 'post_type' => 'any', 'post_status' => 'any', 'orderby' => 'ID' ) ); 
     222        $this->assertEquals( 11, count($posts) ); 
     223 
     224        $post = $posts[0]; 
     225        $this->assertEquals( 'Many Categories', $post->post_title ); 
     226        $this->assertEquals( 'many-categories', $post->post_name ); 
     227        $this->assertEquals( $admin->ID, $post->post_author ); 
     228        $this->assertEquals( 'post', $post->post_type ); 
     229        $this->assertEquals( 'publish', $post->post_status ); 
     230        $this->assertEquals( 0, $post->post_parent ); 
     231        $cats = wp_get_post_categories( $post->ID ); 
     232        $this->assertEquals( 27, count($cats) ); 
     233 
     234        $post = $posts[1]; 
     235        $this->assertEquals( 'Non-standard post format', $post->post_title ); 
     236        $this->assertEquals( 'non-standard-post-format', $post->post_name ); 
     237        $this->assertEquals( $admin->ID, $post->post_author ); 
     238        $this->assertEquals( 'post', $post->post_type ); 
     239        $this->assertEquals( 'publish', $post->post_status ); 
     240        $this->assertEquals( 0, $post->post_parent ); 
     241        $cats = wp_get_post_categories( $post->ID ); 
     242        $this->assertEquals( 1, count($cats) ); 
     243        $this->assertTrue( has_post_format( 'aside', $post->ID ) ); 
     244 
     245        $post = $posts[2]; 
     246        $this->assertEquals( 'Top-level Foo', $post->post_title ); 
     247        $this->assertEquals( 'top-level-foo', $post->post_name ); 
     248        $this->assertEquals( $admin->ID, $post->post_author ); 
     249        $this->assertEquals( 'post', $post->post_type ); 
     250        $this->assertEquals( 'publish', $post->post_status ); 
     251        $this->assertEquals( 0, $post->post_parent ); 
     252        $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) ); 
     253        $this->assertEquals( 1, count($cats) ); 
     254        $this->assertEquals( 'foo', $cats[0]->slug ); 
     255 
     256        $post = $posts[3]; 
     257        $this->assertEquals( 'Foo-child', $post->post_title ); 
     258        $this->assertEquals( 'foo-child', $post->post_name ); 
     259        $this->assertEquals( $editor->ID, $post->post_author ); 
     260        $this->assertEquals( 'post', $post->post_type ); 
     261        $this->assertEquals( 'publish', $post->post_status ); 
     262        $this->assertEquals( 0, $post->post_parent ); 
     263        $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) ); 
     264        $this->assertEquals( 1, count($cats) ); 
     265        $this->assertEquals( 'foo-bar', $cats[0]->slug ); 
     266 
     267        $post = $posts[4]; 
     268        $this->assertEquals( 'Private Post', $post->post_title ); 
     269        $this->assertEquals( 'private-post', $post->post_name ); 
     270        $this->assertEquals( $admin->ID, $post->post_author ); 
     271        $this->assertEquals( 'post', $post->post_type ); 
     272        $this->assertEquals( 'private', $post->post_status ); 
     273        $this->assertEquals( 0, $post->post_parent ); 
     274        $cats = wp_get_post_categories( $post->ID ); 
     275        $this->assertEquals( 1, count($cats) ); 
     276        $tags = wp_get_post_tags( $post->ID ); 
     277        $this->assertEquals( 3, count($tags) ); 
     278        $this->assertEquals( 'tag1', $tags[0]->slug ); 
     279        $this->assertEquals( 'tag2', $tags[1]->slug ); 
     280        $this->assertEquals( 'tag3', $tags[2]->slug ); 
     281 
     282        $post = $posts[5]; 
     283        $this->assertEquals( '1-col page', $post->post_title ); 
     284        $this->assertEquals( '1-col-page', $post->post_name ); 
     285        $this->assertEquals( $admin->ID, $post->post_author ); 
     286        $this->assertEquals( 'page', $post->post_type ); 
     287        $this->assertEquals( 'publish', $post->post_status ); 
     288        $this->assertEquals( 0, $post->post_parent ); 
     289        $this->assertEquals( 'onecolumn-page.php', get_post_meta( $post->ID, '_wp_page_template', true ) ); 
     290 
     291        $post = $posts[6]; 
     292        $this->assertEquals( 'Draft Page', $post->post_title ); 
     293        $this->assertEquals( '', $post->post_name ); 
     294        $this->assertEquals( $admin->ID, $post->post_author ); 
     295        $this->assertEquals( 'page', $post->post_type ); 
     296        $this->assertEquals( 'draft', $post->post_status ); 
     297        $this->assertEquals( 0, $post->post_parent ); 
     298        $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) ); 
     299 
     300        $post = $posts[7]; 
     301        $this->assertEquals( 'Parent Page', $post->post_title ); 
     302        $this->assertEquals( 'parent-page', $post->post_name ); 
     303        $this->assertEquals( $admin->ID, $post->post_author ); 
     304        $this->assertEquals( 'page', $post->post_type ); 
     305        $this->assertEquals( 'publish', $post->post_status ); 
     306        $this->assertEquals( 0, $post->post_parent ); 
     307        $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) ); 
     308 
     309        $post = $posts[8]; 
     310        $this->assertEquals( 'Child Page', $post->post_title ); 
     311        $this->assertEquals( 'child-page', $post->post_name ); 
     312        $this->assertEquals( $admin->ID, $post->post_author ); 
     313        $this->assertEquals( 'page', $post->post_type ); 
     314        $this->assertEquals( 'publish', $post->post_status ); 
     315        $this->assertEquals( $posts[7]->ID, $post->post_parent ); 
     316        $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) ); 
     317 
     318        $post = $posts[9]; 
     319        $this->assertEquals( 'Sample Page', $post->post_title ); 
     320        $this->assertEquals( 'sample-page', $post->post_name ); 
     321        $this->assertEquals( $admin->ID, $post->post_author ); 
     322        $this->assertEquals( 'page', $post->post_type ); 
     323        $this->assertEquals( 'publish', $post->post_status ); 
     324        $this->assertEquals( 0, $post->post_parent ); 
     325        $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) ); 
     326 
     327        $post = $posts[10]; 
     328        $this->assertEquals( 'Hello world!', $post->post_title ); 
     329        $this->assertEquals( 'hello-world', $post->post_name ); 
     330        $this->assertEquals( $author->ID, $post->post_author ); 
     331        $this->assertEquals( 'post', $post->post_type ); 
     332        $this->assertEquals( 'publish', $post->post_status ); 
     333        $this->assertEquals( 0, $post->post_parent ); 
     334        $cats = wp_get_post_categories( $post->ID ); 
     335        $this->assertEquals( 1, count($cats) ); 
     336    } 
     337     
     338    function test_double_import() { 
     339        $authors = array( 'admin' => true, 'editor' => true, 'author' => true );     
     340        $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors ); 
     341        $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors ); 
     342 
     343        $user_count = count_users(); 
     344        $this->assertEquals( 3, $user_count['total_users'] ); 
     345        $admin = get_user_by( 'login', 'admin' ); 
     346        $this->assertEquals( 'admin', $admin->user_login ); 
     347        $this->assertEquals( 'local@host.null', $admin->user_email ); 
     348        $editor = get_user_by( 'login', 'editor' ); 
     349        $this->assertEquals( 'editor', $editor->user_login ); 
     350        $this->assertEquals( 'editor@example.org', $editor->user_email ); 
     351        $this->assertEquals( 'FirstName', $editor->user_firstname ); 
     352        $this->assertEquals( 'LastName', $editor->user_lastname ); 
     353        $author = get_user_by( 'login', 'author' ); 
     354        $this->assertEquals( 'author', $author->user_login ); 
     355        $this->assertEquals( 'author@example.org', $author->user_email ); 
     356 
     357        $this->assertEquals( 30, wp_count_terms( 'category' ) ); 
     358        $this->assertEquals( 3, wp_count_terms( 'post_tag' ) ); 
     359        $foo = get_term_by( 'slug', 'foo', 'category' ); 
     360        $this->assertEquals( 0, $foo->parent ); 
     361        $bar = get_term_by( 'slug', 'bar', 'category' ); 
     362        $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' ); 
     363        $this->assertEquals( $bar->term_id, $foo_bar->parent ); 
     364 
     365        $post_count = wp_count_posts( 'post' ); 
     366        $this->assertEquals( 5, $post_count->publish ); 
     367        $this->assertEquals( 1, $post_count->private ); 
     368        $page_count = wp_count_posts( 'page' ); 
     369        $this->assertEquals( 4, $page_count->publish ); 
     370        $this->assertEquals( 1, $page_count->draft ); 
     371        $comment_count = wp_count_comments(); 
     372        $this->assertEquals( 1, $comment_count->total_comments ); 
     373    } 
     374 
     375    // function test_menu_import 
    2907376} 
    2908377 
    2909 class TestImportWP_PostMetaCDATA extends _WPEmptyBlog { 
    2910  
    2911     var $posts = NULL; 
    2912  
     378class TestImportWP_PostMeta extends _WPEmptyBlog { 
    2913379    function setUp() { 
    2914380        parent::setUp(); 
    2915         include_once(ABSPATH.'/wp-admin/import/wordpress.php'); 
    2916         if ( !defined('WP_IMPORTING') ) 
    2917             define('WP_IMPORTING', true); 
     381         
     382        if ( ! defined( 'WP_IMPORTING' ) ) 
     383            define( 'WP_IMPORTING', true ); 
     384             
     385        if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 
     386            define( 'WP_LOAD_IMPORTERS', true ); 
     387             
     388        require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 
    2918389    } 
    2919390 
    2920391    function tearDown() { 
    2921392        parent::tearDown(); 
    2922         if ($user = get_user_by('login', 'User A')) 
    2923             wp_delete_user($user->ID); 
    2924     } 
    2925  
    2926     //Relates to WP Bug 9633 - this tests the importer against the fix not the exporter 
     393    } 
     394     
     395    function test_serialized_postmeta_no_cdata() { 
     396        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' => false ) );    
     397        $expected['special_post_title'] = 'A special title'; 
     398        $expected['is_calendar'] = '';   
     399        $this->assertEquals( $expected, get_post_meta( 122, 'post-options', true ) ); 
     400    } 
     401     
     402    function test_utw_postmeta() { 
     403        $this->_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' => false ) ); 
     404 
     405        $classy = new StdClass(); 
     406        $classy->tag =  "album"; 
     407        $expected[] = $classy; 
     408        $classy = new StdClass(); 
     409        $classy->tag =  "apple"; 
     410        $expected[] = $classy; 
     411        $classy = new StdClass(); 
     412        $classy->tag =  "art"; 
     413        $expected[] = $classy; 
     414        $classy = new StdClass(); 
     415        $classy->tag =  "artwork"; 
     416        $expected[] = $classy;   
     417        $classy = new StdClass(); 
     418        $classy->tag =  "dead-tracks"; 
     419        $expected[] = $classy;   
     420        $classy = new StdClass(); 
     421        $classy->tag =  "ipod"; 
     422        $expected[] = $classy; 
     423        $classy = new StdClass(); 
     424        $classy->tag =  "itunes"; 
     425        $expected[] = $classy; 
     426        $classy = new StdClass(); 
     427        $classy->tag =  "javascript"; 
     428        $expected[] = $classy; 
     429        $classy = new StdClass(); 
     430        $classy->tag =  "lyrics"; 
     431        $expected[] = $classy;   
     432        $classy = new StdClass(); 
     433        $classy->tag =  "script"; 
     434        $expected[] = $classy;   
     435        $classy = new StdClass(); 
     436        $classy->tag =  "tracks"; 
     437        $expected[] = $classy;   
     438        $classy = new StdClass(); 
     439        $classy->tag =  "windows-scripting-host"; 
     440        $expected[] = $classy;   
     441        $classy = new StdClass(); 
     442        $classy->tag =  "wscript"; 
     443        $expected[] = $classy;   
     444         
     445        $this->assertEquals( $expected, get_post_meta( 150, 'test', true ) ); 
     446    } 
     447} 
     448 
     449class TestImportWP_PostMetaCDATA extends _WPEmptyBlog { 
     450    function setUp() { 
     451        parent::setUp(); 
     452 
     453        if ( ! defined( 'WP_IMPORTING' ) ) 
     454            define( 'WP_IMPORTING', true ); 
     455 
     456        if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 
     457            define( 'WP_LOAD_IMPORTERS', true ); 
     458 
     459        require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 
     460    } 
     461 
     462    function tearDown() { 
     463        parent::tearDown(); 
     464    } 
     465 
     466    // #9633 
    2927467    function test_serialized_postmeta_with_cdata() { 
    2928         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/test-serialized-postmeta-with-cdata.xml', array('User A') ) ); 
    2929  
    2930         //HTML in the CDATA should work with old WordPress versions 
    2931         $this->assertEquals('<pre>some html</pre>', get_post_meta(10, 'contains-html', true)); 
    2932  
     468        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => false ) ); 
     469 
     470        //HTML in the CDATA should work with old WordPress version 
     471        $this->assertEquals( '<pre>some html</pre>', get_post_meta( 10, 'contains-html', true ) );       
    2933472        //Serialised will only work with 3.0 onwards. 
    2934473        $expected["special_post_title"] = "A special title"; 
    2935         $expected["is_calendar"]= ""; 
    2936         $this->assertEquals($expected, get_post_meta(10, 'post-options', true)); 
    2937          
    2938     } 
    2939  
     474        $expected["is_calendar"] = ""; 
     475        $this->assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );         
     476    } 
     477 
     478    // #11574 
    2940479    function test_serialized_postmeta_with_evil_stuff_in_cdata() { 
    2941         $this->knownWPBug(11574); 
    2942         $html_output = get_echo( array(&$this, '_import_wp'), array( DIR_TESTDATA.'/export/test-serialized-postmeta-with-cdata.xml', array('User A') ) ); 
    2943  
    2944         //Evil content in the CDATA 
    2945         //<wp:meta_value>evil</wp:meta_value> 
    2946         $this->assertEquals('<wp:meta_value>evil</wp:meta_value>', get_post_meta(10, 'evil', true)); 
    2947     } 
    2948  
     480        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => false ) ); 
     481        // evil content in the CDATA 
     482        $this->assertEquals( '<wp:meta_value>evil</wp:meta_value>', get_post_meta( 10, 'evil', true ) ); 
     483    } 
    2949484} 
     485 
    2950486?> 
  • wp-testdata/sample_blogs.php

    r178 r323  
    1313    function setUp() { 
    1414        parent::setUp(); 
    15         $this->author = get_userdatabylogin(WP_USER_NAME); 
     15 
     16        $this->author = get_userdatabylogin( WP_USER_NAME ); 
    1617        $this->_delete_all_posts(); 
    1718        update_option('home', 'http://example.com'); 
     
    5455    function setUp() { 
    5556        parent::setUp(); 
    56         include_once(ABSPATH.'/wp-admin/import/wordpress.php'); 
    57         $this->_import_wp(DIR_TESTDATA.'/'.$this->import_filename); 
     57 
     58        if ( ! defined( 'WP_IMPORTING' ) ) 
     59            define( 'WP_IMPORTING', true ); 
     60             
     61        if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 
     62            define( 'WP_LOAD_IMPORTERS', true ); 
     63             
     64        require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 
     65 
     66        $this->_import_wp( DIR_TESTDATA.'/'.$this->import_filename ); 
    5867    } 
    5968} 
  • wp-testlib/base.php

    r316 r323  
    176176        if ($all_posts) { 
    177177            foreach ($all_posts as $id) 
    178                 wp_delete_post($id); 
     178                wp_delete_post( $id, true ); 
    179179        } 
    180180    } 
     
    209209 
    210210    // import a WXR file 
    211     function _import_wp($filename, $users = array(), $fetch_files = true) { 
     211    function _import_wp( $filename, $users = array(), $fetch_files = true ) { 
    212212        $importer = new WP_Import(); 
    213         $path = realpath($filename); 
    214         assert('!empty($path)'); 
    215         assert('is_file($path)'); 
    216  
    217         $author_in = array(); 
    218         $user_create = array(); 
    219         $userselect = array(); 
    220         foreach ($users as $k=>$v) 
    221             $userselect[$k] = '0'; 
    222         $i=0; 
    223         foreach ($users as $author => $user) { 
    224             $author_in[$i] = $author; 
    225             $user_create[$i] = $user; 
     213        $file = realpath( $filename ); 
     214        assert('!empty($file)'); 
     215        assert('is_file($file)'); 
     216 
     217        $authors = $mapping = array(); 
     218        $i = 0; 
     219        foreach ( $users as $user => $create ) { 
     220            $authors[$i] = $user; 
     221            // either create a new user or map to user ID 1 (WP_USER_NAME) 
     222            if ( $create ) { 
     223                $new[$i] = $user; 
     224            } else { 
     225                $mapping[$i] = 1; 
     226            } 
     227 
    226228            $i++; 
    227229        } 
    228230 
    229         $_POST = array('author_in' => $author_in, 'user_create'=>$user_create, 'user_select'=>$userselect); 
    230  
    231         // this is copied from WP_Import::import() 
    232         // we can't call that function directly because it expects a file ID 
    233         $file = realpath($filename); 
    234         global $wpdb; 
    235         $qcount_start = $wpdb->num_queries; 
    236         #add_filter('query', 'dmp_filter'); 
    237         if (is_callable(array(&$importer, 'import_file'))) { 
    238             $importer->fetch_attachments = $fetch_files; 
    239             $importer->import_file($file); 
    240         } 
    241         else { 
    242             $importer->file = $file; 
    243             $importer->get_authors_from_post(); 
    244             $importer->get_entries(array(&$importer, 'process_post')); 
    245             $importer->process_categories(); 
    246             $importer->process_tags(); 
    247             $importer->process_posts(); 
    248         } 
    249         #remove_filter('query', 'dmp_filter'); 
    250         $qcount_delta = $wpdb->num_queries - $qcount_start; 
    251         dmp("import query count: $qcount_delta"); 
     231        $_POST = array( 'imported_authors' => $authors, 'user_map' => $mapping, 'user_new' => $new ); 
     232 
     233        ob_start(); 
     234        $importer->fetch_attachments = $fetch_files; 
     235        $importer->import( $file ); 
     236        ob_end_clean(); 
     237 
    252238        $_POST = array(); 
    253239    } 
Note: See TracChangeset for help on using the changeset viewer.