create([ 'name' => 'Test Sub Location', ]); expect($subLocation->name)->toBe('Test Sub Location') ->and($subLocation->exists)->toBeTrue(); }); it('has guarded attributes', function () { $guarded = ['id']; expect(SubLocation::make()->getGuarded())->toEqual($guarded); }); it('belongs to location', function () { $subLocation = SubLocation::factory()->create(); expect($subLocation->location())->toBeInstanceOf(\Illuminate\Database\Eloquent\Relations\BelongsTo::class); }); it('casts is_active to enum', function () { $subLocation = SubLocation::factory()->create(['is_active' => IsActive::ACTIVE]); expect($subLocation->is_active)->toBeInstanceOf(IsActive::class) ->and($subLocation->is_active)->toBe(IsActive::ACTIVE); }); });