-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
5 Model unit tests in tests/Feature/Models/SecretAttachmentTest.php failing due to improper encryption pattern in test setup.
Root Cause
Secret::create() and SecretAttachment::create() do NOT follow explicit property assignment pattern required for EncryptedWithDek cast.
Required: $model = new Model(); $model->tenant_id = $tenantId; $model->encrypted_field = $value; $model->save();
Current (broken): Model::create(['tenant_id' => ..., 'encrypted_field' => ...]);
Failing Tests
- secret attachment uses UUID primary key
- secret attachment encrypts filename with EncryptedWithDek cast
- secret attachment belongs to secret
- secret attachment belongs to user (uploaded_by)
- secret attachment has download_url accessor
Solution
Replace all ::create() calls with explicit property assignment pattern.
Impact
- Tests failing but functionality works (Controller tests 13/13 passing)
- Blocks: Nothing (PR feat: File Attachments API (Phase 2) #175 #177 can proceed)
Related
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
✅ Done