mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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:
@@ -268,17 +268,18 @@ class Tests_TestHelpers extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @ticket 36166
|
||||
* @expectedException WPDieException
|
||||
*/
|
||||
public function test_die_handler_should_handle_wp_error() {
|
||||
$this->expectException( 'WPDieException' );
|
||||
|
||||
wp_die( new WP_Error( 'test', 'test' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 46813
|
||||
* @expectedException WPDieException
|
||||
*/
|
||||
public function test_die_handler_should_not_cause_doing_it_wrong_notice_without_wp_query_set() {
|
||||
$this->expectException( 'WPDieException' );
|
||||
unset( $GLOBALS['wp_query'] );
|
||||
|
||||
wp_die();
|
||||
|
||||
Reference in New Issue
Block a user