From d4de97ad6fcc4694ed1acfd85bb559c2f6087e55 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 2 Nov 2016 05:54:27 +0000 Subject: [PATCH] Roles: Fix a PHP error introduced in [39082]. The now deprecated `WP_Roles::reinit()` method was trying to call `__deprecated_function()`, instead of `_deprecated_function()`. See 23016. git-svn-id: https://develop.svn.wordpress.org/trunk@39088 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-roles.php | 2 +- tests/phpunit/tests/user/capabilities.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-roles.php b/src/wp-includes/class-wp-roles.php index f829d8146a..23e05d7b1b 100644 --- a/src/wp-includes/class-wp-roles.php +++ b/src/wp-includes/class-wp-roles.php @@ -149,7 +149,7 @@ class WP_Roles { * @access public */ public function reinit() { - __deprecated_function( __METHOD__, '4.7.0', 'new WP_Roles()' ); + _deprecated_function( __METHOD__, '4.7.0', 'new WP_Roles()' ); $this->_init(); } diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index 0948d88e75..8ed2c65857 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -1654,4 +1654,13 @@ class Tests_User_Capabilities extends WP_UnitTestCase { public function _hook_wp_roles_init( $wp_roles ) { $wp_roles->add_role( $this->_role_test_wp_roles_init['role'], $this->_role_test_wp_roles_init['info']['name'], $this->_role_test_wp_roles_init['info']['capabilities'] ); } + + /** + * @ticket 23016 + * @expectedDeprecated WP_Roles::reinit + */ + public function test_wp_roles_reinit_deprecated() { + $wp_roles = new WP_Roles(); + $wp_roles->reinit(); + } }