|
11 | 11 |
|
12 | 12 | namespace CodeIgniter\Debug; |
13 | 13 |
|
| 14 | +use CodeIgniter\Database\Exceptions\DatabaseException; |
| 15 | +use CodeIgniter\Entity\Exceptions\CastException; |
| 16 | +use CodeIgniter\Exceptions\ConfigException; |
14 | 17 | use CodeIgniter\Exceptions\PageNotFoundException; |
15 | 18 | use CodeIgniter\Test\CIUnitTestCase; |
16 | 19 | use CodeIgniter\Test\ReflectionHelper; |
@@ -57,9 +60,16 @@ public function testDetermineCodes(): void |
57 | 60 | { |
58 | 61 | $determineCodes = $this->getPrivateMethodInvoker($this->exception, 'determineCodes'); |
59 | 62 |
|
60 | | - $this->assertSame([500, 9], $determineCodes(new RuntimeException('This.'))); |
61 | | - $this->assertSame([500, 1], $determineCodes(new RuntimeException('That.', 600))); |
62 | | - $this->assertSame([404, 1], $determineCodes(new RuntimeException('There.', 404))); |
| 63 | + $this->assertSame([500, EXIT__AUTO_MIN], $determineCodes(new RuntimeException('This.'))); |
| 64 | + $this->assertSame([500, EXIT_ERROR], $determineCodes(new RuntimeException('That.', 600))); |
| 65 | + $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.'))); |
63 | 73 | } |
64 | 74 |
|
65 | 75 | public function testRenderBacktrace(): void |
|
0 commit comments