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

    r48937 r48996  
    180180    }
    181181
    182     /**
    183      * @expectedException PHPUnit_Framework_Error_Deprecated
    184      */
    185182    function test_json_encode_decode() {
     183        $this->expectException( 'PHPUnit_Framework_Error_Deprecated' );
     184
    186185        require_once ABSPATH . WPINC . '/class-json.php';
    187186        $json = new Services_JSON();
Note: See TracChangeset for help on using the changeset viewer.