| @@ 331-338 (lines=8) @@ | ||
| 328 | $this->assertTrue(wp_notify_moderator($c)); |
|
| 329 | } |
|
| 330 | ||
| 331 | public function test_wp_new_comment_notify_postauthor_should_send_email_when_comment_is_approved() |
|
| 332 | { |
|
| 333 | $c = self::factory()->comment->create( |
|
| 334 | array( |
|
| 335 | 'comment_post_ID' => self::$post_id, |
|
| 336 | ) |
|
| 337 | ); |
|
| 338 | ||
| 339 | $sent = wp_new_comment_notify_postauthor($c); |
|
| 340 | $this->assertTrue($sent); |
|
| 341 | } |
|
| @@ 343-351 (lines=9) @@ | ||
| 340 | $this->assertTrue($sent); |
|
| 341 | } |
|
| 342 | ||
| 343 | public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_is_unapproved() |
|
| 344 | { |
|
| 345 | $c = self::factory()->comment->create( |
|
| 346 | array( |
|
| 347 | 'comment_post_ID' => self::$post_id, |
|
| 348 | 'comment_approved' => '0', |
|
| 349 | ) |
|
| 350 | ); |
|
| 351 | ||
| 352 | $sent = wp_new_comment_notify_postauthor($c); |
|
| 353 | $this->assertFalse($sent); |
|
| 354 | } |
|
| @@ 359-367 (lines=9) @@ | ||
| 356 | /** |
|
| 357 | * @ticket 33587 |
|
| 358 | */ |
|
| 359 | public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_marked_as_spam() |
|
| 360 | { |
|
| 361 | $c = self::factory()->comment->create( |
|
| 362 | array( |
|
| 363 | 'comment_post_ID' => self::$post_id, |
|
| 364 | 'comment_approved' => 'spam', |
|
| 365 | ) |
|
| 366 | ); |
|
| 367 | ||
| 368 | $sent = wp_new_comment_notify_postauthor($c); |
|
| 369 | $this->assertFalse($sent); |
|
| 370 | } |
|
| @@ 375-383 (lines=9) @@ | ||
| 372 | /** |
|
| 373 | * @ticket 35006 |
|
| 374 | */ |
|
| 375 | public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_trashed() |
|
| 376 | { |
|
| 377 | $c = self::factory()->comment->create( |
|
| 378 | array( |
|
| 379 | 'comment_post_ID' => self::$post_id, |
|
| 380 | 'comment_approved' => 'trash', |
|
| 381 | ) |
|
| 382 | ); |
|
| 383 | ||
| 384 | $sent = wp_new_comment_notify_postauthor($c); |
|
| 385 | $this->assertFalse($sent); |
|
| 386 | } |
|