Make WordPress Core

Changeset 981 in tests


Ignore:
Timestamp:
08/21/2012 10:17:26 AM (12 years ago)
Author:
westi
Message:

Comments: Use the Factory to create our test comment for us. Props nbachiyski.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/comment.php

    r980 r981  
    99    var $post_id;
    1010    var $comment_id;
    11     var $comment_data;
    1211
    1312    function setUp() {
     
    1514
    1615        $this->post_id = $this->factory->post->create();
    17 
    18         $this->comment_data = array(
    19             'comment_post_ID' => $this->post_id,
    20             'comment_author' => 'Test commenter',
    21             'comment_author_url' => 'http://example.com/',
    22             'comment_author_email' => 'example@example.com',
    23             'comment_content' => rand_str( 100 ),
    24         );
    25         $this->comment_id = wp_insert_comment( $this->comment_data );
     16        $this->comment_id = $this->factory->comment->create();
    2617    }
    2718
Note: See TracChangeset for help on using the changeset viewer.