Make WordPress Core


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

    r48937 r48997  
    9191
    9292        // Make the request.
    93         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     93        $this->expectException( 'WPAjaxDieStopException' );
     94        $this->expectExceptionMessage( '-1' );
    9495        $this->_handleAjax( 'get-comments' );
    9596    }
     
    111112
    112113        // Make the request.
    113         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     114        $this->expectException( 'WPAjaxDieStopException' );
     115        $this->expectExceptionMessage( '-1' );
    114116        $this->_handleAjax( 'get-comments' );
    115117    }
     
    131133
    132134        // Make the request.
    133         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     135        $this->expectException( 'WPAjaxDieStopException' );
     136        $this->expectExceptionMessage( '-1' );
    134137        $this->_handleAjax( 'get-comments' );
    135138    }
     
    149152
    150153        // Make the request.
    151         $this->setExpectedException( 'WPAjaxDieStopException', '1' );
     154        $this->expectException( 'WPAjaxDieStopException' );
     155        $this->expectExceptionMessage( '1' );
    152156        $this->_handleAjax( 'get-comments' );
    153157    }
Note: See TracChangeset for help on using the changeset viewer.