Make WordPress Core


Ignore:
Timestamp:
06/30/2020 12:41:30 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for Ajax comment tests per the documentation standards.

See #49572.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/DeleteComment.php

    r47198 r48220  
    1717
    1818    /**
    19      * List of comments
     19     * List of comments.
    2020     *
    2121     * @var array
     
    3838
    3939    /**
    40      * Clear the POST actions in between requests
     40     * Clears the POST actions in between requests.
    4141     */
    4242    protected function _clear_post_action() {
     
    5454
    5555    /**
    56      * Test as a privilged user (administrator)
    57      * Expects test to pass
    58      *
    59      * @param mixed $comment Comment object
    60      * @param string action trash, untrash, etc.
    61      * @return void
     56     * Tests as a privileged user (administrator).
     57     *
     58     * Expects test to pass.
     59     *
     60     * @param WP_Comment $comment Comment object.
     61     * @param string     $action  Action: 'trash', 'untrash', etc.
    6262     */
    6363    public function _test_as_admin( $comment, $action ) {
     
    113113
    114114    /**
    115      * Test as a non-privileged user (subscriber)
    116      * Expects test to fail
    117      *
    118      * @param mixed $comment Comment object
    119      * @param string action trash, untrash, etc.
    120      * @return void
     115     * Tests as a non-privileged user (subscriber).
     116     *
     117     * Expects test to fail.
     118     *
     119     * @param WP_Comment $comment Comment object.
     120     * @param string     $action  Action: 'trash', 'untrash', etc.
    121121     */
    122122    public function _test_as_subscriber( $comment, $action ) {
     
    144144
    145145    /**
    146      * Test with a bad nonce
    147      * Expects test to fail
    148      *
    149      * @param mixed $comment Comment object
    150      * @param string action trash, untrash, etc.
    151      * @return void
     146     * Tests with a bad nonce.
     147     *
     148     * Expects test to fail.
     149     *
     150     * @param WP_Comment $comment Comment object.
     151     * @param string     $action  Action: 'trash', 'untrash', etc.
    152152     */
    153153    public function _test_with_bad_nonce( $comment, $action ) {
     
    174174
    175175    /**
    176      * Test with a bad id
    177      * Expects test to fail
    178      *
    179      * @param mixed $comment Comment object
    180      * @param string action trash, untrash, etc.
    181      * @return void
     176     * Tests with a bad ID.
     177     *
     178     * Expects test to fail.
     179     *
     180     * @param WP_Comment $comment Comment object.
     181     * @param string     $action  Action: 'trash', 'untrash', etc.
    182182     */
    183183    public function _test_with_bad_id( $comment, $action ) {
     
    211211
    212212    /**
    213      * Test doubling the action (e.g. trash a trashed comment)
    214      * Expects test to fail
    215      *
    216      * @param mixed $comment Comment object
    217      * @param string action trash, untrash, etc.
    218      * @return void
     213     * Tests doubling the action (e.g. trash a trashed comment).
     214     *
     215     * Expects test to fail.
     216     *
     217     * @param WP_Comment $comment Comment object.
     218     * @param string     $action  Action: 'trash', 'untrash', etc.
    219219     */
    220220    public function _test_double_action( $comment, $action ) {
     
    261261
    262262    /**
    263      * Delete a comment as an administrator (expects success)
    264      *
    265      * @return void
     263     * Deletes a comment as an administrator (expects success).
    266264     */
    267265    public function test_ajax_comment_trash_actions_as_administrator() {
     
    279277
    280278    /**
    281      * Delete a comment as a subscriber (expects permission denied)
    282      *
    283      * @return void
     279     * Deletes a comment as a subscriber (expects permission denied).
    284280     */
    285281    public function test_ajax_comment_trash_actions_as_subscriber() {
     
    297293
    298294    /**
    299      * Delete a comment with no id
    300      *
    301      * @return void
     295     * Deletes a comment with no ID.
    302296     */
    303297    public function test_ajax_trash_comment_no_id() {
     
    315309
    316310    /**
    317      * Delete a comment with a bad nonce
    318      *
    319      * @return void
     311     * Deletes a comment with a bad nonce.
    320312     */
    321313    public function test_ajax_trash_comment_bad_nonce() {
     
    333325
    334326    /**
    335      * Test trashing an already trashed comment, etc.
    336      *
    337      * @return void
     327     * Tests trashing an already trashed comment, etc.
    338328     */
    339329    public function test_ajax_trash_double_action() {
Note: See TracChangeset for help on using the changeset viewer.