File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 390390 </tr>
391391 </thead>
392392 <tbody>
393- <?php foreach ($ values as $ field => $ value ) : ?>
393+ <?php
394+ foreach ($ values as $ field => $ value ) :
395+ if ($ value instanceof UnitEnum) {
396+ $ value = $ value ::class . ':: ' . $ value ->name ;
397+ }
398+ ?>
394399 <tr>
395400 <th><?= htmlentities ($ field ) ?> </th>
396401 <td><?= htmlentities ((string ) $ value ) ?> </td>
397402 </tr>
398- <?php endforeach ?>
403+ <?php
404+ endforeach
405+ ?>
399406 </tbody>
400407 </table>
401408 <?php endforeach ?>
Original file line number Diff line number Diff line change 1616use Framework \Log \Logger ;
1717use Framework \Log \Loggers \FileLogger ;
1818use Framework \Log \Loggers \SysLogger ;
19+ use Framework \Log \LogLevel ;
1920use PHPUnit \Framework \TestCase ;
2021
2122final class ExceptionHandlerTest extends TestCase
@@ -63,6 +64,17 @@ public function testDevelopmentView() : void
6364 $ exceptions ->setDevelopmentView ('/unknown/foo.php ' );
6465 }
6566
67+ public function testDevelopmentViewWithEnum () : void
68+ {
69+ $ _ENV ['logger.default.level ' ] = LogLevel::CRITICAL ;
70+ $ exceptions = new ExceptionHandlerMock (ExceptionHandler::DEVELOPMENT );
71+ $ exceptions ->cli = false ;
72+ \ob_start ();
73+ $ exceptions ->exceptionHandler (new \Exception ('Foo ' ));
74+ \ob_end_clean ();
75+ self ::assertTrue (true ); // This test is only to increase coverage.
76+ }
77+
6678 public function testProductionView () : void
6779 {
6880 $ exceptions = new ExceptionHandler ();
You can’t perform that action at this time.
0 commit comments