Changeset 36119
- Timestamp:
- 12/29/2015 05:53:23 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r36115 r36119 1803 1803 1804 1804 // Only send notifications for approved comments. 1805 if ( ! isset( $comment->comment_approved ) || ' spam' === $comment->comment_approved || !$comment->comment_approved ) {1805 if ( ! isset( $comment->comment_approved ) || '1' != $comment->comment_approved ) { 1806 1806 return false; 1807 1807 } -
trunk/tests/phpunit/tests/comment.php
r35853 r36119 294 294 } 295 295 296 public function test_wp_new_comment_notify_postauthor_should_send_email_when_comment_is_approved() { 297 $c = self::factory()->comment->create( array( 298 'comment_post_ID' => self::$post_id, 299 ) ); 300 301 $sent = wp_new_comment_notify_postauthor( $c ); 302 $this->assertTrue( $sent ); 303 } 304 305 public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_is_unapproved() { 306 $c = self::factory()->comment->create( array( 307 'comment_post_ID' => self::$post_id, 308 'comment_approved' => '0', 309 ) ); 310 311 $sent = wp_new_comment_notify_postauthor( $c ); 312 $this->assertFalse( $sent ); 313 } 314 296 315 /** 297 316 * @ticket 33587 … … 301 320 'comment_post_ID' => self::$post_id, 302 321 'comment_approved' => 'spam', 322 ) ); 323 324 $sent = wp_new_comment_notify_postauthor( $c ); 325 $this->assertFalse( $sent ); 326 } 327 328 /** 329 * @ticket 35006 330 */ 331 public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_trashed() { 332 $c = self::factory()->comment->create( array( 333 'comment_post_ID' => self::$post_id, 334 'comment_approved' => 'trash', 303 335 ) ); 304 336
Note: See TracChangeset
for help on using the changeset viewer.