Comments: Unit test for `wp_get_comment_fields_max_lengths().

This adds tests for the comment form field lengths returned by `wp_get_comment_fields_max_lengths()`. Replaces unit test removed in r36514. 

See #10377.

git-svn-id: https://develop.svn.wordpress.org/trunk@36515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2016-02-12 14:17:13 +00:00
parent 8718eb2536
commit cff37450eb

View File

@ -673,4 +673,18 @@ class Tests_Comment extends WP_UnitTestCase {
$this->assertSame( 'SHIELD_AGENT', $updated->comment_agent );
}
public function test_wp_get_comment_fields_max_lengths() {
$expected = array(
'comment_author' => 245,
'comment_author_email' => 100,
'comment_author_url' => 200,
'comment_content' => 65525,
);
$lengths = wp_get_comment_fields_max_lengths();
foreach ( $lengths as $field => $length ) {
$this->assertSame( $expected[ $field ], $length );
}
}
}