Make WordPress Core


Ignore:
Timestamp:
09/18/2020 01:48:27 PM (6 years 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/CustomizeMenus.php

    r48937 r48997  
    5454
    5555                if ( 'administrator' !== $role ) {
    56                         // If we're not an admin, we should get a wp_die(-1).
    57                         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     56                        // If we're not an admin, we should get a wp_die( -1 ).
     57                        $this->expectException( 'WPAjaxDieStopException' );
     58                        $this->expectExceptionMessage( '-1' );
    5859                }
    5960
    … …  
    443444
    444445                if ( 'administrator' !== $role ) {
    445                         // If we're not an admin, we should get a wp_die(-1).
    446                         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     446                        // If we're not an admin, we should get a wp_die( -1 ).
     447                        $this->expectException( 'WPAjaxDieStopException' );
     448                        $this->expectExceptionMessage( '-1' );
    447449                }
    448450
Note: See TracChangeset for help on using the changeset viewer.