Code Modernization: Use wp_trigger_error() in WP_List_Table magic methods.

Replaces `trigger_error()` with `wp_trigger_error()` in each of the `WP_List_Table` magic methods.

[56349] added the dynamic properties deprecation messages to the `__get()`, `__set()`, `__isset()`, `__unset()` magic methods. Since that commit, `wp_trigger_error()` was introduced (see [56530]) as a wrapper for `trigger_error()`.

Follow-up to [56349], [56356], [56530].

See #58896, #57686.

git-svn-id: https://develop.svn.wordpress.org/trunk@56542 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork
2023-09-07 20:39:07 +00:00
parent ef54f4e57f
commit dc76011874
2 changed files with 12 additions and 4 deletions

View File

@@ -389,6 +389,7 @@ class Tests_Admin_WpListTable extends WP_UnitTestCase {
public function test_should_throw_deprecation_when_getting_dynamic_property() {
$this->expectDeprecation();
$this->expectDeprecationMessage(
'WP_List_Table::__get(): ' .
'The property `undeclared_property` is not declared. Getting a dynamic property is ' .
'deprecated since version 6.4.0! Instead, declare the property on the class.'
);
@@ -418,6 +419,7 @@ class Tests_Admin_WpListTable extends WP_UnitTestCase {
public function test_should_throw_deprecation_when_setting_dynamic_property() {
$this->expectDeprecation();
$this->expectDeprecationMessage(
'WP_List_Table::__set(): ' .
'The property `undeclared_property` is not declared. Setting a dynamic property is ' .
'deprecated since version 6.4.0! Instead, declare the property on the class.'
);
@@ -450,6 +452,7 @@ class Tests_Admin_WpListTable extends WP_UnitTestCase {
public function test_should_throw_deprecation_when_isset_of_dynamic_property() {
$this->expectDeprecation();
$this->expectDeprecationMessage(
'WP_List_Table::__isset(): ' .
'The property `undeclared_property` is not declared. Checking `isset()` on a dynamic property ' .
'is deprecated since version 6.4.0! Instead, declare the property on the class.'
);
@@ -477,6 +480,7 @@ class Tests_Admin_WpListTable extends WP_UnitTestCase {
public function test_should_throw_deprecation_when_unset_of_dynamic_property() {
$this->expectDeprecation();
$this->expectDeprecationMessage(
'WP_List_Table::__unset(): ' .
'A property `undeclared_property` is not declared. Unsetting a dynamic property is ' .
'deprecated since version 6.4.0! Instead, declare the property on the class.'
);