WordPress.org

Make WordPress Core

Ticket #40584: 40584.diff

File 40584.diff, 890 bytes (added by stephdau, 2 years ago)

Adding required update_option( 'comment_whitelist', 0 );, and switching to rightful $this->assertTrue( $results );

  • tests/phpunit/tests/comment/checkComment.php

     
    8383        }
    8484
    8585        public function test_should_return_true_when_content_does_not_match_moderation_keys() {
     86                update_option( 'comment_whitelist', 0 );
     87
    8688                $author       = 'WendytheBuilder';
    8789                $author_email = 'wendy@example.com';
    8890                $author_url   = 'http://example.com';
     
    9395
    9496                update_option( 'moderation_keys',"foo\nbar" );
    9597                $results = check_comment( $author, $author_email, $author_url, $comment, $author_ip, $user_agent, $comment_type );
    96                 $this->assertFalse( $results );
     98                $this->assertTrue( $results );
    9799        }
    98100
    99101        public function test_should_return_false_when_link_count_exceeds_comment_max_length_setting() {