Make WordPress Core

Changeset 25383


Ignore:
Timestamp:
09/12/2013 04:59:29 AM (11 years ago)
Author:
wonderboymusic
Message:

Add a post_id fixture in test/meta/slashes.php so Undefined variable: comment_post_ID notices don't fire when creating comments.

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/meta/slashes.php

    r25002 r25383  
    1010        parent::setUp();
    1111        $this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
     12        $this->post_id = $this->factory->post->create();
    1213        $this->old_current_user = get_current_user_id();
    1314        wp_set_current_user( $this->author_id );
     
    174175     */
    175176    function test_add_comment_meta() {
    176         $id = $this->factory->comment->create();
     177        $id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    177178
    178179        add_comment_meta( $id, 'slash_test_1', $this->slash_1 );
     
    198199     */
    199200    function test_update_comment_meta() {
    200         $id = $this->factory->comment->create();
     201        $id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    201202
    202203        add_comment_meta( $id, 'slash_test_1', 'foo' );
Note: See TracChangeset for help on using the changeset viewer.