refactor: Improve note ID validation and error handling

- Improve input validation and error handling in Note model
- Add test case for out-of-range note IDs in NotesController
This commit is contained in:
Jonny Barnes 2023-06-11 12:52:07 +01:00
parent d47c8c00f3
commit 71cb15d007
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 15 additions and 0 deletions

View file

@ -73,4 +73,11 @@ class NotesControllerTest extends TestCase
$response = $this->get('/notes/112233');
$response->assertNotFound();
}
/** @test */
public function checkNoteIdNotOutOfRange(): void
{
$response = $this->get('/notes/photou-photologo');
$response->assertNotFound();
}
}