MCPcopy
hub / github.com/pocketbase/pocketbase / TestRecordLoad

Function TestRecordLoad

core/record_model_test.go:772–795  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

770}
771
772func TestRecordLoad(t *testing.T) {
773 t.Parallel()
774
775 collection := core.NewBaseCollection("test")
776 collection.Fields.Add(&core.TextField{Name: "text"})
777
778 record := core.NewRecord(collection)
779 record.Load(map[string]any{
780 "text": 123,
781 "custom": 456,
782 })
783
784 expected := map[string]any{
785 "text": "123",
786 "custom": 456,
787 }
788
789 for k, v := range expected {
790 get := record.Get(k)
791 if get != v {
792 t.Errorf("Expected %q to be %#v, got %#v", k, v, get)
793 }
794 }
795}
796
797func TestRecordGetBool(t *testing.T) {
798 t.Parallel()

Callers

nothing calls this directly

Calls 5

LoadMethod · 0.95
GetMethod · 0.95
NewBaseCollectionFunction · 0.92
NewRecordFunction · 0.92
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…