Skip to content

Commit e52c06f

Browse files
committed
test: add assertions
1 parent 56e3af0 commit e52c06f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/system/Debug/ExceptionsTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace CodeIgniter\Debug;
1313

14+
use CodeIgniter\Database\Exceptions\DatabaseException;
15+
use CodeIgniter\Entity\Exceptions\CastException;
16+
use CodeIgniter\Exceptions\ConfigException;
1417
use CodeIgniter\Exceptions\PageNotFoundException;
1518
use CodeIgniter\Test\CIUnitTestCase;
1619
use CodeIgniter\Test\ReflectionHelper;
@@ -60,6 +63,13 @@ public function testDetermineCodes(): void
6063
$this->assertSame([500, EXIT__AUTO_MIN], $determineCodes(new RuntimeException('This.')));
6164
$this->assertSame([500, EXIT_ERROR], $determineCodes(new RuntimeException('That.', 600)));
6265
$this->assertSame([404, EXIT_ERROR], $determineCodes(new RuntimeException('There.', 404)));
66+
$this->assertSame([167, EXIT_ERROR], $determineCodes(new RuntimeException('This.', 167)));
67+
// @TODO This exit code should be EXIT_CONFIG.
68+
$this->assertSame([500, 12], $determineCodes(new ConfigException('This.')));
69+
// @TODO This exit code should be EXIT_CONFIG.
70+
$this->assertSame([500, 9], $determineCodes(new CastException('This.')));
71+
// @TODO This exit code should be EXIT_DATABASE.
72+
$this->assertSame([500, 17], $determineCodes(new DatabaseException('This.')));
6373
}
6474

6575
public function testRenderBacktrace(): void

0 commit comments

Comments
 (0)