WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/tests/phpunit/tests/comment.php

    r35475 r36146  
    279279    }
    280280
     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
    281300    /**
    282301     * @ticket 33587
     
    286305            'comment_post_ID' => self::$post_id,
    287306            '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',
    288320        ) );
    289321
Note: See TracChangeset for help on using the changeset viewer.