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