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

Function TestOrderedPHPAssociativeArray

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

Source from the content-addressed store, hash-verified

53}
54
55func TestOrderedPHPAssociativeArray(t *testing.T) {
56 testOnDummyPHPThread(t, func() {
57 originalArray := AssociativeArray[string]{
58 Map: map[string]string{
59 "foo1": "bar1",
60 "foo2": "bar2",
61 },
62 Order: []string{"foo2", "foo1"},
63 }
64
65 phpArray := PHPAssociativeArray(originalArray)
66 defer zendHashDestroy(phpArray)
67 convertedArray, err := GoAssociativeArray[string](phpArray)
68 require.NoError(t, err)
69
70 assert.Equal(t, originalArray, convertedArray, "associative array should be equal after conversion")
71 })
72}
73
74func TestPHPPackedArray(t *testing.T) {
75 testOnDummyPHPThread(t, func() {

Callers

nothing calls this directly

Calls 3

testOnDummyPHPThreadFunction · 0.85
PHPAssociativeArrayFunction · 0.85
zendHashDestroyFunction · 0.85

Tested by

no test coverage detected