MCPcopy Index your code
hub / github.com/php/frankenphp / TestNestedMixedArray

Function TestNestedMixedArray

types_test.go:124–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestNestedMixedArray(t *testing.T) {
125 testOnDummyPHPThread(t, func() {
126 originalArray := map[string]any{
127 "string": "value",
128 "int": int64(123),
129 "float": 1.2,
130 "true": true,
131 "false": false,
132 "nil": nil,
133 "packedArray": []any{"bar1", "bar2"},
134 "associativeArray": AssociativeArray[any]{
135 Map: map[string]any{"foo1": "bar1", "foo2": "bar2"},
136 Order: []string{"foo2", "foo1"},
137 },
138 }
139
140 phpArray := PHPMap(originalArray)
141 defer zendHashDestroy(phpArray)
142 convertedArray, err := GoMap[any](phpArray)
143 require.NoError(t, err)
144
145 assert.Equal(t, originalArray, convertedArray, "nested mixed array should be equal after conversion")
146 })
147}

Callers

nothing calls this directly

Calls 3

testOnDummyPHPThreadFunction · 0.85
PHPMapFunction · 0.85
zendHashDestroyFunction · 0.85

Tested by

no test coverage detected