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

Function TestPHPPackedArrayToGoMap

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

Source from the content-addressed store, hash-verified

85}
86
87func TestPHPPackedArrayToGoMap(t *testing.T) {
88 testOnDummyPHPThread(t, func() {
89 originalSlice := []string{"bar1", "bar2"}
90 expectedMap := map[string]string{
91 "0": "bar1",
92 "1": "bar2",
93 }
94
95 phpArray := PHPPackedArray(originalSlice)
96 defer zendHashDestroy(phpArray)
97 convertedMap, err := GoMap[string](phpArray)
98 require.NoError(t, err)
99
100 assert.Equal(t, expectedMap, convertedMap, "convert a packed to an associative array")
101 })
102}
103
104func TestPHPAssociativeArrayToPacked(t *testing.T) {
105 testOnDummyPHPThread(t, func() {

Callers

nothing calls this directly

Calls 3

testOnDummyPHPThreadFunction · 0.85
PHPPackedArrayFunction · 0.85
zendHashDestroyFunction · 0.85

Tested by

no test coverage detected