From cff37450eb8949cd50cc534886ee73b4291aa884 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Fri, 12 Feb 2016 14:17:13 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/comment.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php index de03212f25..296606108a 100644 --- a/tests/phpunit/tests/comment.php +++ b/tests/phpunit/tests/comment.php @@ -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 ); + } + } }