Make WordPress Core

Changeset 36515


Ignore:
Timestamp:
02/12/2016 02:17:13 PM (9 years ago)
Author:
rachelbaker
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r36514 r36515  
    674674    }
    675675
     676    public function test_wp_get_comment_fields_max_lengths() {
     677        $expected = array(
     678            'comment_author'       => 245,
     679            'comment_author_email' => 100,
     680            'comment_author_url'   => 200,
     681            'comment_content'      => 65525,
     682        );
     683
     684        $lengths = wp_get_comment_fields_max_lengths();
     685
     686        foreach ( $lengths as $field => $length ) {
     687            $this->assertSame( $expected[ $field ], $length );
     688        }
     689    }
    676690}
Note: See TracChangeset for help on using the changeset viewer.