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/TagSearch.php

    r48937 r48997  
    7575        // Make the request.
    7676        // No output, so we get a stop exception.
    77         $this->setExpectedException( 'WPAjaxDieStopException', '' );
     77        $this->expectException( 'WPAjaxDieStopException' );
     78        $this->expectExceptionMessage( '' );
    7879        $this->_handleAjax( 'ajax-tag-search' );
    7980    }
     
    115116
    116117        // Make the request.
    117         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     118        $this->expectException( 'WPAjaxDieStopException' );
     119        $this->expectExceptionMessage( '-1' );
    118120        $this->_handleAjax( 'ajax-tag-search' );
    119121    }
     
    132134
    133135        // Make the request.
    134         $this->setExpectedException( 'WPAjaxDieStopException', '0' );
     136        $this->expectException( 'WPAjaxDieStopException' );
     137        $this->expectExceptionMessage( '0' );
    135138        $this->_handleAjax( 'ajax-tag-search' );
    136139    }
     
    149152
    150153        // Make the request.
    151         $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
     154        $this->expectException( 'WPAjaxDieStopException' );
     155        $this->expectExceptionMessage( '-1' );
    152156        $this->_handleAjax( 'ajax-tag-search' );
    153157    }
Note: See TracChangeset for help on using the changeset viewer.