Make WordPress Core


Ignore:
Timestamp:
06/04/2015 05:28:07 PM (9 years ago)
Author:
boonebgorges
Message:

In wp_notify_moderator(), don't throw notice when comment belongs to a post with no author.

Props Oxymoron.
Fixes #32566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r32364 r32692  
    149149        }
    150150    }
     151
     152    /**
     153     * @ticket 32566
     154     */
     155    public function test_wp_notify_moderator_should_not_throw_notice_when_post_author_is_0() {
     156        $p = $this->factory->post->create( array(
     157            'post_author' => 0,
     158        ) );
     159
     160        $c = $this->factory->comment->create( array(
     161            'comment_post_ID' => $p,
     162        ) );
     163
     164        $this->assertTrue( wp_notify_moderator( $c ) );
     165    }
    151166}
Note: See TracChangeset for help on using the changeset viewer.