WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/18/2020 01:48:27 PM (7 months ago)
Author:
SergeyBiryukov
Message:

Tests: Switch Ajax tests to use the expectException() method directly, instead of the WP_UnitTestCase_Base::setExpectedException() wrapper.

This brings some consistency with other tests.

Follow-up to [48996].

See #51344.

File:
1 edited

Legend:

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

    r48937 r48997  
    150150
    151151        // Make the request.
    152         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     152        $this->expectException( 'WPAjaxDieStopException' );
     153        $this->expectExceptionMessage( '-1' );
    153154        $this->_handleAjax( 'edit-comment' );
    154155    }
     
    178179
    179180        // Make the request.
    180         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     181        $this->expectException( 'WPAjaxDieStopException' );
     182        $this->expectExceptionMessage( '-1' );
    181183        $this->_handleAjax( 'get-comments' );
    182184    }
     
    198200
    199201        // Make the request.
    200         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     202        $this->expectException( 'WPAjaxDieStopException' );
     203        $this->expectExceptionMessage( '-1' );
    201204        $this->_handleAjax( 'edit-comment' );
    202205    }
     
    226229
    227230        // Make the request.
    228         $this->setExpectedException( 'WPAjaxDieStopException', 'wp_update_comment_data filter fails for this comment.' );
     231        $this->expectException( 'WPAjaxDieStopException' );
     232        $this->expectExceptionMessage( 'wp_update_comment_data filter fails for this comment.' );
    229233        $this->_handleAjax( 'edit-comment' );
    230234    }
Note: See TracChangeset for help on using the changeset viewer.