feat: add comprehensive tests for Medium, OtpCode, Shift models and various Enums
This commit is contained in:
+9
-8
@@ -32,7 +32,8 @@ app/Enums/ShiftDayEnum.php → tests/Unit/Enums/ShiftDayEnum
|
||||
app/Models/Shift.php → tests/Feature/Models/ShiftTest.php
|
||||
```
|
||||
|
||||
- `tests/Unit/` — no database, no facades. Enums only.
|
||||
- `tests/Unit/` — no database. Enums only; extend `PHPUnit\Framework\TestCase` unless a framework helper is needed
|
||||
(`EnumHasOptionsTest` extends `Tests\TestCase` because `options()` calls `__()`).
|
||||
- `tests/Feature/` — boots the app, uses `RefreshDatabase` (sqlite `:memory:`, already configured in `phpunit.xml`).
|
||||
- The default `ExampleTest` placeholders have been removed; never re-add them.
|
||||
|
||||
@@ -178,19 +179,19 @@ Legend: `☐` not written · `☑` written · `—` intentionally not tested
|
||||
|
||||
| Priority | Source | Test | Status |
|
||||
|----------|--------|------|--------|
|
||||
| P3 | `app/Enums/ShiftDayEnum.php` | `tests/Unit/Enums/ShiftDayEnumTest.php` | ☐ |
|
||||
| P3 | `app/Enums/DocumentModalityEnum.php` | `tests/Unit/Enums/DocumentModalityEnumTest.php` | ☐ |
|
||||
| P3 | `app/Enums/DocumentPriorityEnum.php` | `tests/Unit/Enums/DocumentPriorityEnumTest.php` | ☐ |
|
||||
| P3 | `app/Enums/EnumHasOptions.php` (via any enum using it) | `tests/Unit/Enums/EnumHasOptionsTest.php` | ☐ |
|
||||
| P3 | `app/Enums/ShiftDayEnum.php` | `tests/Unit/Enums/ShiftDayEnumTest.php` | ☑ |
|
||||
| P3 | `app/Enums/DocumentModalityEnum.php` | `tests/Unit/Enums/DocumentModalityEnumTest.php` | ☑ |
|
||||
| P3 | `app/Enums/DocumentPriorityEnum.php` | `tests/Unit/Enums/DocumentPriorityEnumTest.php` | ☑ |
|
||||
| P3 | `app/Enums/EnumHasOptions.php` (via any enum using it) | `tests/Unit/Enums/EnumHasOptionsTest.php` | ☑ |
|
||||
| — | all other enums (values only) | | — |
|
||||
|
||||
### Models
|
||||
|
||||
| Priority | Source | Test | Status |
|
||||
|----------|--------|------|--------|
|
||||
| P3 | `app/Models/Shift.php` (`scopeActive`, `scopeOpen`) | `tests/Feature/Models/ShiftTest.php` | ☐ |
|
||||
| P3 | `app/Models/Medium.php` (`fullUrl`, `humanSize`, `exists`, `isPublic`, `isPrivate`, `deleteFile`) | `tests/Feature/Models/MediumTest.php` | ☐ |
|
||||
| P3 | `app/Models/OtpCode.php` (`isExpired`) | `tests/Feature/Models/OtpCodeTest.php` | ☐ |
|
||||
| P3 | `app/Models/Shift.php` (`scopeActive`, `scopeOpen`) | `tests/Feature/Models/ShiftTest.php` | ☑ |
|
||||
| P3 | `app/Models/Medium.php` (`fullUrl`, `humanSize`, `exists`, `isPublic`, `isPrivate`, `deleteFile`) | `tests/Feature/Models/MediumTest.php` | ☑ |
|
||||
| P3 | `app/Models/OtpCode.php` (`isExpired`) | `tests/Feature/Models/OtpCodeTest.php` | ☑ |
|
||||
| — | all other models (relations / fillable only) | | — |
|
||||
|
||||
### Factories
|
||||
|
||||
Reference in New Issue
Block a user