You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trigger_error( 'AVISO: Piso mojado durante filtro.', E_USER_WARNING );
1037
+
},
1038
+
'emit_action_errors' => staticfunction () {
1039
+
trigger_error( 'AVISO: Piso mojado durante acción.', E_USER_WARNING );
1029
1040
},
1030
1041
'expected_processed' => true,
1031
1042
'expected_error_log' => array(
1032
-
'PHP Warning: AVISO: Piso mojado. in __FILE__ on line __LINE__',
1043
+
'PHP Warning: AVISO: Piso mojado durante filtro. in __FILE__ on line __LINE__',
1044
+
'PHP Warning: AVISO: Piso mojado durante acción. in __FILE__ on line __LINE__',
1033
1045
),
1034
1046
'expected_displayed_errors' => array(
1035
-
'<b>Warning</b>: AVISO: Piso mojado. in <b>__FILE__</b> on line <b>__LINE__</b>',
1047
+
'<b>Warning</b>: AVISO: Piso mojado durante filtro. in <b>__FILE__</b> on line <b>__LINE__</b>',
1036
1048
),
1037
1049
),
1038
1050
'error' => array(
1039
1051
'ini_config_options' => $log_and_display_all,
1040
-
'emit_errors' => staticfunction () {
1041
-
@trigger_error( 'ERROR: Can this mistake be rectified?', E_USER_ERROR ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
1052
+
'emit_filter_errors' => staticfunction () {
1053
+
@trigger_error( 'ERROR: Can this mistake be rectified during filter?', E_USER_ERROR ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
1054
+
},
1055
+
'emit_action_errors' => staticfunction () {
1056
+
@trigger_error( 'ERROR: Can this mistake be rectified during action?', E_USER_ERROR ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
1042
1057
},
1043
1058
'expected_processed' => false,
1044
1059
'expected_error_log' => array(
1045
-
'PHP Warning: Uncaught exception "Exception" thrown: User error triggered: ERROR: Can this mistake be rectified? in __FILE__ on line __LINE__',
1060
+
'PHP Warning: Uncaught exception "Exception" thrown: User error triggered: ERROR: Can this mistake be rectified during filter? in __FILE__ on line __LINE__',
1061
+
'PHP Warning: Exception thrown during wp_finalized_template_enhancement_output_buffer action: User error triggered: ERROR: Can this mistake be rectified during action? in __FILE__ on line __LINE__',
1046
1062
),
1047
1063
'expected_displayed_errors' => array(
1048
-
'<b>Error</b>: Uncaught exception "Exception" thrown: User error triggered: ERROR: Can this mistake be rectified? in <b>__FILE__</b> on line <b>__LINE__</b>',
1064
+
'<b>Error</b>: Uncaught exception "Exception" thrown: User error triggered: ERROR: Can this mistake be rectified during filter? in <b>__FILE__</b> on line <b>__LINE__</b>',
1049
1065
),
1050
1066
),
1051
1067
'exception' => array(
1052
1068
'ini_config_options' => $log_and_display_all,
1053
-
'emit_errors' => staticfunction () {
1054
-
thrownewException( 'I take exception to this!' );
1069
+
'emit_filter_errors' => staticfunction () {
1070
+
thrownewException( 'I take exception to this filter!' );
1071
+
},
1072
+
'emit_action_errors' => staticfunction () {
1073
+
thrownewException( 'I take exception to this action!' );
1055
1074
},
1056
1075
'expected_processed' => false,
1057
1076
'expected_error_log' => array(
1058
-
'PHP Warning: Uncaught exception "Exception" thrown: I take exception to this! in __FILE__ on line __LINE__',
1077
+
'PHP Warning: Uncaught exception "Exception" thrown: I take exception to this filter! in __FILE__ on line __LINE__',
1078
+
'PHP Warning: Exception thrown during wp_finalized_template_enhancement_output_buffer action: I take exception to this action! in __FILE__ on line __LINE__',
1059
1079
),
1060
1080
'expected_displayed_errors' => array(
1061
-
'<b>Error</b>: Uncaught exception "Exception" thrown: I take exception to this! in <b>__FILE__</b> on line <b>__LINE__</b>',
1081
+
'<b>Error</b>: Uncaught exception "Exception" thrown: I take exception to this filter! in <b>__FILE__</b> on line <b>__LINE__</b>',
1062
1082
),
1063
1083
),
1064
1084
'multiple_non_errors' => array(
1065
1085
'ini_config_options' => $log_and_display_all,
1066
-
'emit_errors' => staticfunction () {
1067
-
trigger_error( 'You are history.', E_USER_DEPRECATED );
1068
-
trigger_error( 'POSTED: No trespassing.', E_USER_NOTICE );
trigger_error( 'You are history during filter.', E_USER_DEPRECATED );
1088
+
trigger_error( 'POSTED: No trespassing during filter.', E_USER_NOTICE );
1089
+
trigger_error( 'AVISO: Piso mojado durante filtro.', E_USER_WARNING );
1090
+
},
1091
+
'emit_action_errors' => staticfunction () {
1092
+
trigger_error( 'You are history during action.', E_USER_DEPRECATED );
1093
+
trigger_error( 'POSTED: No trespassing during action.', E_USER_NOTICE );
1094
+
trigger_error( 'AVISO: Piso mojado durante acción.', E_USER_WARNING );
1070
1095
},
1071
1096
'expected_processed' => true,
1072
1097
'expected_error_log' => array(
1073
-
'PHP Deprecated: You are history. in __FILE__ on line __LINE__',
1074
-
'PHP Notice: POSTED: No trespassing. in __FILE__ on line __LINE__',
1075
-
'PHP Warning: AVISO: Piso mojado. in __FILE__ on line __LINE__',
1098
+
'PHP Deprecated: You are history during filter. in __FILE__ on line __LINE__',
1099
+
'PHP Notice: POSTED: No trespassing during filter. in __FILE__ on line __LINE__',
1100
+
'PHP Warning: AVISO: Piso mojado durante filtro. in __FILE__ on line __LINE__',
1101
+
'PHP Deprecated: You are history during action. in __FILE__ on line __LINE__',
1102
+
'PHP Notice: POSTED: No trespassing during action. in __FILE__ on line __LINE__',
1103
+
'PHP Warning: AVISO: Piso mojado durante acción. in __FILE__ on line __LINE__',
1076
1104
),
1077
1105
'expected_displayed_errors' => array(
1078
-
'<b>Deprecated</b>: You are history. in <b>__FILE__</b> on line <b>__LINE__</b>',
1079
-
'<b>Notice</b>: POSTED: No trespassing. in <b>__FILE__</b> on line <b>__LINE__</b>',
1080
-
'<b>Warning</b>: AVISO: Piso mojado. in <b>__FILE__</b> on line <b>__LINE__</b>',
1106
+
'<b>Deprecated</b>: You are history during filter. in <b>__FILE__</b> on line <b>__LINE__</b>',
1107
+
'<b>Notice</b>: POSTED: No trespassing during filter. in <b>__FILE__</b> on line <b>__LINE__</b>',
1108
+
'<b>Warning</b>: AVISO: Piso mojado durante filtro. in <b>__FILE__</b> on line <b>__LINE__</b>',
1081
1109
),
1082
1110
),
1083
1111
'deprecated_without_html' => array(
@@ -1087,28 +1115,33 @@ public function data_provider_to_test_wp_finalize_template_enhancement_output_bu
1087
1115
'html_errors' => false,
1088
1116
)
1089
1117
),
1090
-
'emit_errors' => staticfunction () {
1091
-
trigger_error( 'You are history.', E_USER_DEPRECATED );
1118
+
'emit_filter_errors' => staticfunction () {
1119
+
trigger_error( 'You are history during filter.', E_USER_DEPRECATED );
1092
1120
},
1121
+
'emit_action_errors' => null,
1093
1122
'expected_processed' => true,
1094
1123
'expected_error_log' => array(
1095
-
'PHP Deprecated: You are history. in __FILE__ on line __LINE__',
1124
+
'PHP Deprecated: You are history during filter. in __FILE__ on line __LINE__',
1096
1125
),
1097
1126
'expected_displayed_errors' => array(
1098
-
'Deprecated: You are history. in __FILE__ on line __LINE__',
1127
+
'Deprecated: You are history during filter. in __FILE__ on line __LINE__',
1099
1128
),
1100
1129
),
1101
1130
'warning_in_eval' => array(
1102
1131
'ini_config_options' => $log_and_display_all,
1103
-
'emit_errors' => staticfunction () {
1104
-
eval( "trigger_error( 'AVISO: Piso mojado.', E_USER_WARNING );" ); // phpcs:ignore Squiz.PHP.Eval.Discouraged -- We're in a test!
1132
+
'emit_filter_errors' => staticfunction () {
1133
+
eval( "trigger_error( 'AVISO: Piso mojado durante filtro.', E_USER_WARNING );" ); // phpcs:ignore Squiz.PHP.Eval.Discouraged -- We're in a test!
1134
+
},
1135
+
'emit_action_errors' => staticfunction () {
1136
+
eval( "trigger_error( 'AVISO: Piso mojado durante acción.', E_USER_WARNING );" ); // phpcs:ignore Squiz.PHP.Eval.Discouraged -- We're in a test!
1105
1137
},
1106
1138
'expected_processed' => true,
1107
1139
'expected_error_log' => array(
1108
-
'PHP Warning: AVISO: Piso mojado. in __FILE__ : eval()\'d code on line __LINE__',
1140
+
'PHP Warning: AVISO: Piso mojado durante filtro. in __FILE__ : eval()\'d code on line __LINE__',
1141
+
'PHP Warning: AVISO: Piso mojado durante acción. in __FILE__ : eval()\'d code on line __LINE__',
1109
1142
),
1110
1143
'expected_displayed_errors' => array(
1111
-
'<b>Warning</b>: AVISO: Piso mojado. in <b>__FILE__ : eval()\'d code</b> on line <b>__LINE__</b>',
1144
+
'<b>Warning</b>: AVISO: Piso mojado durante filtro. in <b>__FILE__ : eval()\'d code</b> on line <b>__LINE__</b>',
1112
1145
),
1113
1146
),
1114
1147
);
@@ -1160,16 +1193,16 @@ static function ( $log_entry ) {
1160
1193
}
1161
1194
1162
1195
/**
1163
-
* Tests that errors emitted when filtering wp_template_enhancement_output_buffer are handled as expected.
1196
+
* Tests that errors are handled as expected when errors are emitted when filtering wp_template_enhancement_output_buffer or doing the wp_finalize_template_enhancement_output_buffer action.
0 commit comments