diff --git a/src/wp-includes/class-wp-text-diff-renderer-table.php b/src/wp-includes/class-wp-text-diff-renderer-table.php index b54aa6c368..c0cf35b653 100644 --- a/src/wp-includes/class-wp-text-diff-renderer-table.php +++ b/src/wp-includes/class-wp-text-diff-renderer-table.php @@ -521,7 +521,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { return $this->$name; } - trigger_error( + wp_trigger_error( + __METHOD__, "The property `{$name}` is not declared. Getting a dynamic property is " . 'deprecated since version 6.4.0! Instead, declare the property on the class.', E_USER_DEPRECATED @@ -544,7 +545,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { return; } - trigger_error( + wp_trigger_error( + __METHOD__, "The property `{$name}` is not declared. Setting a dynamic property is " . 'deprecated since version 6.4.0! Instead, declare the property on the class.', E_USER_DEPRECATED @@ -565,7 +567,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { return isset( $this->$name ); } - trigger_error( + wp_trigger_error( + __METHOD__, "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " . 'is deprecated since version 6.4.0! Instead, declare the property on the class.', E_USER_DEPRECATED @@ -587,7 +590,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { return; } - trigger_error( + wp_trigger_error( + __METHOD__, "A property `{$name}` is not declared. Unsetting a dynamic property is " . 'deprecated since version 6.4.0! Instead, declare the property on the class.', E_USER_DEPRECATED diff --git a/tests/phpunit/tests/diff/wpTextDiffRendererTable.php b/tests/phpunit/tests/diff/wpTextDiffRendererTable.php index 4dbbdbbefe..7b85a78582 100644 --- a/tests/phpunit/tests/diff/wpTextDiffRendererTable.php +++ b/tests/phpunit/tests/diff/wpTextDiffRendererTable.php @@ -43,6 +43,7 @@ class Tests_Diff_WpTextDiffRendererTable extends WP_UnitTestCase { public function test_should_throw_deprecation_when_getting_dynamic_property() { $this->expectDeprecation(); $this->expectDeprecationMessage( + 'WP_Text_Diff_Renderer_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.' ); @@ -72,6 +73,7 @@ class Tests_Diff_WpTextDiffRendererTable extends WP_UnitTestCase { public function test_should_throw_deprecation_when_setting_dynamic_property() { $this->expectDeprecation(); $this->expectDeprecationMessage( + 'WP_Text_Diff_Renderer_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.' ); @@ -104,6 +106,7 @@ class Tests_Diff_WpTextDiffRendererTable extends WP_UnitTestCase { public function test_should_throw_deprecation_when_isset_of_dynamic_property() { $this->expectDeprecation(); $this->expectDeprecationMessage( + 'WP_Text_Diff_Renderer_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.' ); @@ -131,6 +134,7 @@ class Tests_Diff_WpTextDiffRendererTable extends WP_UnitTestCase { public function test_should_throw_deprecation_when_unset_of_dynamic_property() { $this->expectDeprecation(); $this->expectDeprecationMessage( + 'WP_Text_Diff_Renderer_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.' );