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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48996 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-09-18 13:22:22 +00:00
parent f78acee893
commit d46af0956d
10 changed files with 22 additions and 27 deletions
+2 -3
View File
@@ -524,11 +524,10 @@ class Tests_DB extends WP_UnitTestCase {
$this->assertEmpty( $wpdb->check_database_version() );
}
/**
* @expectedException WPDieException
*/
function test_bail() {
global $wpdb;
$this->expectException( 'WPDieException' );
$wpdb->bail( 'Database is dead.' );
}