Changeset 36146
- Timestamp:
- 01/02/2016 03:34:35 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/comment.php
r36039 r36146 1806 1806 1807 1807 // Only send notifications for approved comments. 1808 if ( ! isset( $comment->comment_approved ) || ' spam' === $comment->comment_approved || !$comment->comment_approved ) {1808 if ( ! isset( $comment->comment_approved ) || '1' != $comment->comment_approved ) { 1809 1809 return false; 1810 1810 } -
branches/4.4/tests/phpunit/tests/comment.php
r35475 r36146 279 279 } 280 280 281 public function test_wp_new_comment_notify_postauthor_should_send_email_when_comment_is_approved() { 282 $c = self::factory()->comment->create( array( 283 'comment_post_ID' => self::$post_id, 284 ) ); 285 286 $sent = wp_new_comment_notify_postauthor( $c ); 287 $this->assertTrue( $sent ); 288 } 289 290 public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_is_unapproved() { 291 $c = self::factory()->comment->create( array( 292 'comment_post_ID' => self::$post_id, 293 'comment_approved' => '0', 294 ) ); 295 296 $sent = wp_new_comment_notify_postauthor( $c ); 297 $this->assertFalse( $sent ); 298 } 299 281 300 /** 282 301 * @ticket 33587 … … 286 305 'comment_post_ID' => self::$post_id, 287 306 'comment_approved' => 'spam', 307 ) ); 308 309 $sent = wp_new_comment_notify_postauthor( $c ); 310 $this->assertFalse( $sent ); 311 } 312 313 /** 314 * @ticket 35006 315 */ 316 public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_trashed() { 317 $c = self::factory()->comment->create( array( 318 'comment_post_ID' => self::$post_id, 319 'comment_approved' => 'trash', 288 320 ) ); 289 321
Note: See TracChangeset
for help on using the changeset viewer.