Skip to content

Commit 2ef5af1

Browse files
committed
Add test case for display_errors=stderr
1 parent 5b13a71 commit 2ef5af1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/phpunit/tests/template.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,26 @@ public function data_provider_to_test_wp_finalize_template_enhancement_output_bu
11591159
'<b>Warning</b>: AVISO: Piso mojado durante acción. in <b>__FILE__ : eval()\'d code</b> on line <b>__LINE__</b>',
11601160
),
11611161
),
1162+
'notice_with_display_errors_stderr' => array(
1163+
'ini_config_options' => array_merge(
1164+
$log_and_display_all,
1165+
array(
1166+
'display_errors' => 'stderr',
1167+
)
1168+
),
1169+
'emit_filter_errors' => static function () {
1170+
trigger_error( 'POSTED: No trespassing during filter.' );
1171+
},
1172+
'emit_action_errors' => static function () {
1173+
trigger_error( 'POSTED: No trespassing during action.' );
1174+
},
1175+
'expected_processed' => true,
1176+
'expected_error_log' => array(
1177+
'PHP Notice: POSTED: No trespassing during filter. in __FILE__ on line __LINE__',
1178+
'PHP Notice: POSTED: No trespassing during action. in __FILE__ on line __LINE__',
1179+
),
1180+
'expected_displayed_errors' => array(),
1181+
),
11621182
);
11631183

11641184
$tests_error_reporting_warnings_and_above = array();

0 commit comments

Comments
 (0)