Make WordPress Core


Ignore:
Timestamp:
10/30/2022 01:05:06 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Rename classes in phpunit/tests/ajax/ per the naming conventions.

This updates the test classes to match the names of the functions being tested.

Includes moving the @covers tags from individual test methods to the class DocBlocks.

Reference: Writing PHP Tests: Naming and Organization.

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489], [53561], [54704].

See #56793.

File:
1 moved

Legend:

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

    r54721 r54722  
    99 * Testing Ajax comment functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
     16 *
     17 * @covers ::wp_ajax_delete_comment
    1518 */
    16 class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxDeleteComment extends WP_Ajax_UnitTestCase {
    1720
    1821    /**
     
    5861     * Expects test to pass.
    5962     *
    60      * @covers ::wp_ajax_delete_comment
    6163     * @covers ::_wp_ajax_delete_comment_response
    6264     *
     
    120122     * Expects test to fail.
    121123     *
    122      * @covers ::wp_ajax_delete_comment
    123      *
    124124     * @param WP_Comment $comment Comment object.
    125125     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    154154     * Expects test to fail.
    155155     *
    156      * @covers ::wp_ajax_delete_comment
    157      *
    158156     * @param WP_Comment $comment Comment object.
    159157     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    186184     *
    187185     * Expects test to fail.
    188      *
    189      * @covers ::wp_ajax_delete_comment
    190186     *
    191187     * @param WP_Comment $comment Comment object.
     
    226222     * Expects test to fail.
    227223     *
    228      * @covers ::wp_ajax_delete_comment
    229      *
    230224     * @param WP_Comment $comment Comment object.
    231225     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    276270     * Deletes a comment as an administrator (expects success).
    277271     *
    278      * @covers ::wp_ajax_delete_comment
    279272     * @covers ::_wp_ajax_delete_comment_response
    280273     */
     
    294287    /**
    295288     * Deletes a comment as a subscriber (expects permission denied).
    296      *
    297      * @covers ::wp_ajax_delete_comment
    298289     */
    299290    public function test_ajax_comment_trash_actions_as_subscriber() {
     
    313304     * Deletes a comment with no ID.
    314305     *
    315      * @covers ::wp_ajax_delete_comment
    316306     * @covers ::_wp_ajax_delete_comment_response
    317307     */
     
    331321    /**
    332322     * Deletes a comment with a bad nonce.
    333      *
    334      * @covers ::wp_ajax_delete_comment
    335323     */
    336324    public function test_ajax_trash_comment_bad_nonce() {
     
    349337    /**
    350338     * Tests trashing an already trashed comment, etc.
    351      *
    352      * @covers ::wp_ajax_delete_comment
    353339     */
    354340    public function test_ajax_trash_double_action() {
Note: See TracChangeset for help on using the changeset viewer.