Make WordPress Core


Ignore:
Timestamp:
09/18/2020 01:22:22 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Consistently use the expectException() method instead of the older @expectedException annotation.

See https://thephp.cc/news/2016/02/questioning-phpunit-best-practices

The method is available since PHPUnit 5.2, and WordPress currently supports PHPUnit 5.4 as the minimum version.

Follow-up to [48993].

See #51344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/redirect.php

    r48937 r48996  
    2525     *
    2626     * @dataProvider get_bad_status_codes
    27      * @expectedException WPDieException
    2827     *
    2928     * @param string $location The path or URL to redirect to.
     
    3130     */
    3231    public function test_wp_redirect_bad_status_code( $location, $status ) {
     32        $this->expectException( 'WPDieException' );
     33
    3334        wp_redirect( $location, $status );
    3435    }
Note: See TracChangeset for help on using the changeset viewer.