create([ 'name' => 'Test Theme', ]); expect($theme->name)->toBe('Test Theme') ->and($theme->exists)->toBeTrue(); }); it('has guarded attributes', function () { $guarded = ['id']; expect(Theme::make()->getGuarded())->toEqual($guarded); }); it('has media monitorings relationship', function () { $theme = Theme::factory()->create(); expect($theme->mediaMonitorings())->toBeInstanceOf(\Illuminate\Database\Eloquent\Relations\BelongsToMany::class); }); it('scopes active themes', function () { Theme::factory()->create(['is_active' => IsActive::ACTIVE]); Theme::factory()->create(['is_active' => IsActive::INACTIVE]); $activeThemes = Theme::active()->get(); expect($activeThemes)->toHaveCount(1) ->and($activeThemes->first()->is_active)->toBe(IsActive::ACTIVE); }); it('casts is_active to enum', function () { $theme = Theme::factory()->create(['is_active' => IsActive::ACTIVE]); expect($theme->is_active)->toBeInstanceOf(IsActive::class) ->and($theme->is_active)->toBe(IsActive::ACTIVE); }); });