Skip to content

Commit 11613d6

Browse files
committed
test: add test for determineView()
1 parent 9dda86d commit 11613d6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/system/Debug/ExceptionHandlerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ public function testDetermineViewsRuntimeExceptionCode404(): void
7070
$this->assertSame('error_404.php', $viewFile);
7171
}
7272

73+
public function testDetermineViewsDisplayErrorsOffRuntimeException(): void
74+
{
75+
ini_set('display_errors', '0');
76+
77+
$determineView = $this->getPrivateMethodInvoker($this->handler, 'determineView');
78+
79+
$exception = new RuntimeException('Exception');
80+
$templatePath = APPPATH . 'Views/errors/html';
81+
$viewFile = $determineView($exception, $templatePath);
82+
83+
$this->assertSame('production.php', $viewFile);
84+
85+
ini_set('display_errors', '1');
86+
}
87+
7388
public function testCollectVars(): void
7489
{
7590
$collectVars = $this->getPrivateMethodInvoker($this->handler, 'collectVars');

0 commit comments

Comments
 (0)